Are and his friend Dee loves to research the things they find interesting and if possible, they do develop new ideas. They are so famous that some even search for them on the internet, and... Wait, this is irrelevant to this problem.
One day Dee got to know about a very interesting game called Rock-paper-scissors and invited Are to play with him.
The rules of the game are simple. Both of them count to three and simultaneously makes a gesture that represents either rock, paper or scissors. Scissor beats paper(as scissors cut paper), rock beats scissor(as rock crushes scissor) and paper beats rock(as paper covers rock). If both players choose the same shape, then, the game is tied.
After playing N rounds, Are gives you the scoring sheet in which he assigned the numbers 1, 2, 3 but didn't tell you the mapping of any number with its corresponding gesture.
Given the gestures(in form of numbers) made by Are and Dee over N games, determine the maximum number of games the first player(Are) could have possibly won.
Input
The first line of the input contains an integer N − the number of games.
The next N line contains two space-separated integers, either 1, 2 or 3.
Output
Print a single integer, the maximum number of games the first player could have possibly won.
Constraints
1≤N≤105
One solution for this sample case is to have 3 represents "Rock", 2 represents "Scissor" and 1 represents "Paper".