#0000B3

spisak

Election Commission of Bajtograd municipality got a letter from Republic Election Commission about the new ordering of voters, by which the voters get the number which determines their position in the voters list based on their position in the lexicographically sorted voters list for the whole municipality. Unfortunately, this letter arrived only a week before the elections, after they had already sent the voting invitations with numbers based on the old voters list which was not sorted, but the voters were added and removed as they attained or lost their voting right. To save up, the members of commission came up with an idea that they don’t have to send new invitations to everyone, but only to those voters whose numbers differ in the old and the new voters list. Help them count how many invitations they have to send.


InputInput represents the old voters list. In the first row there is a number of voters N, and in the next N rows there are first and last names of the voters, one in each row. Number i was assigned to the voter in the i-th row. First and last names consist of lowercase letters of English alphabet and are separated by an exactly one space character.

OutputIn the first row of standard output, print one number representing the number of invitations that have to be sent again (number of voters whose number differs in the new and the old list).

Limitations:
• Number of voters is smaller than 1000,
• The length of first and last name is shorter than 25 characters,
• Time limit is 1 s.



Input:
4
ana popovic
nikola peric
nemanja tomic
marko djordjevic

Output:
2


Input:
9
ana popovic
nemanja tomic
marko djordjevic
nikola peric
marko djordjevic
ana popovic
nikola peric
sanja popovic
marko djordjevic

Output:
5


Clarification for example 2:
Voters that don’t need a new invitation are: ana popovic (number 1), marko djordjevic (number 3), marko djordjevic (number 5) and nikola peric (number 7). Notice that this new list after the lexicographical sort looks like this: ana popovic, ana popovic, marko djordjevic, marko dordjevic, marko djordjevic, nemanja tomic, nikola peric, nikola peric, sanja popovic.


Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.