Chocolate bars
Probably everyone knows that chocolate is good for the human brain. Therefore, participants in the National Olympiad of the country brought to Olympia to tour a lot of chocolate bars that great ideas come to them faster. But brought the chocolate was too much, and after the tour in the office of the remaining N rectangular tiles, which consisted of cloves 1×1. Two participants agreed to eat a piece of chocolate that was left, but given the fact that during the tour they have eaten enough chocolate, it was decided to do it in quite an unusual way to play, the following rules.
Participants perform certain operations with chocolate bars in turn: first the first, then second, again the first and so on When his party chooses a course of a chocolate bar, with kootoroy he will perform one of the following:
Break the tile into two; fault line should run parallel to the tile and between the lobules.
Break off and eat an arbitrary "line" or "column " tiles, which is not extreme.
Break off and eat all the slices of the tiles that are on the edge, but to then remain on the tile at least one segment (the minimum size of tiles, with kootoroy can be performed such an operation - 3×3).
None of these operations can not be done with the tile of 1×1, so all of these tiles remain tothe end of game . Loses one member, who in their course will not do any of the above operations.
Write a program that according to information on a bar of chocolate left over after the tour, determines the number of options the first move of the first participant to guarantee him a win, subject to a winning strategy in the future.
Input
The first line contains an integer N (1 ≤ N ≤ 100) - number of chocolate bars. The second line contains N pairs of integers, each i-th of which specifies the length and width of the i-th tile. The length and width not less than 1 and not exceed 100.
Output
In a single line of output file should contain an integer - the number of options the first move to the first participant that guarantee him vyigrash, subject them to an optimal strategy in the future.