# Pets and Friends

Anton's birthday is coming soon, and he decided to invite his friends over. He has $n$ friends. Some of them have a dog, a cat, or both pets. But also some of them are afraid of dogs, cats, or both animals at the same time.

Information about the $i$-th friend $(1≤i≤n)$ is represented with two integers $a_{i}$ and $b_{i}$ varying from $0$ to $3$, where $a_{i}$ corresponds to the pets that a friend has, and $b_{i}$ corresponds to the animals which they are afraid of. Here are the meanings of these digits:

$0$ stands for not having / not being afraid of either;

$1$ stands for a dog;

$2$ stands for a cat;

$3$ stands for both animals.

Let the "`x y`

" person be a person that can be described with digits $x$ and $y$. Here are some possible examples of friends:

a "

`1 2`

" person has a dog and is afraid of cats;a "

`0 1`

" person does not have a dog or a cat and is afraid of dogs;a "

`3 0`

" person has a dog and a cat and is not afraid of them;a "

`0 3`

" person does not have either of these animals and is afraid of them, and so on.

All Anton's friends love their pets, so they will not come over without them. But he cannot invite a friend who is afraid of some species of animal and a friend who owns a pet of this species at once.

You need to determine the maximum number of friends Anton can invite.

Please note that:

Anton does not have either and is not afraid of either of these pets;

The combination of invited friends may consist of friends who do not own either pets (for all the indices $j$ of friends invited, $a_{j}$ may be equal to $0$);

It is guaranteed that there are no friends who are afraid of their pets.

## Input

The first line contains one integer $n$ $(1≤n≤10_{5})$ — the number of Anton's friends.

Each of the next $n$ lines contains the information about each friend in the form of two digits $a_{i},b_{i}$ $(0≤a_{i},b_{i}≤3)$ separated by space, where $a_{i}$ stands for pets a friend has and $b_{i}$ — for animals they are afraid of.

It is guaranteed that there are no friends who are afraid of their pets.

## Output

In the only line, you need to output the maximum number of guests that Anton can invite so that there are no friends who are afraid of any of the other's pets.

## Examples

## Note

In the first sample, both friends cannot be invited at once since they both are afraid of each other's pet. But any one of them can still be the only friend invited.

In the second sample, Anton cannot invite all his friends at once since the second one has a cat which the first and the third ones are afraid of. But the first and the third friends can be invited together.

In the third sample, there are the $2$ possible combinations of friends invited:

the $1$-st, $3$-rd, and the $7$-th ones;

the $2$-nd, $4$-th, and the $7$-th ones.

It can be shown that Anton cannot invite more than $3$ friends in this sample.

## Scoring

($9$ points): none of the friends is afraid of either of the animals;

($14$ points): every friend has exactly one pet and is afraid of exactly one animal;

($17$ points): none of the friends has a cat;

($29$ points): every friend has at most one pet and is afraid of at most one animal;

($8$ points): $n≤20$;

($23$ points): no additional constraints.