Chupacabras vs mothmen#4167

Chupacabras vs mothmen

1 second
64 megabytes
Very easy

The arena is a square field with N \times N cells. Chupacabras and mothmen are positioned on the grid. Each of the chupacabras and mothmen has "power" defined by a nonnegative integer; the chupacabras have odd power numbers and the mothmen have even numbers. Chupacabras always move from left to right, and mothmen always move from right to left. When a chupacabra collides with a mothman, the stronger one wins, and the weaker one disappears from the arena.

A chupacabra cannot jump over or step on another chupacabra; the same goes for two mothmen. Define how many chupacabras and mothmen will remain on the arena when no further motion is possible.

Input

The first line of the input file contains a single integer (1 \leq N \leq 100).

The following lines each contain numbers separated by spaces. The -th number of the -th line denotes the "power" of a chupacabra or a mothman situated in the cell with the coordinates , or equals if the cell is empty. The values of numbers denoting power are equal or lower than .

Output

The output file must contain two numbers separated by a space — the number of the remaining mothmen and chupacabras, correspondingly.

Examples

Example 1

Loading
Loading