Hungry OWL and Foolish EAGLE (Easy)

1.7

3 votes
Very-Easy
Problem

In a magical forest, EAGLE went to OWL for classes. OWL taught EAGLE N stories with chapter numbers 1 to N. At the end of the day, OWL used to ask EAGLE to repeat all the Chapter Numbers with its Story Name.

OWL is a nice teacher, so didn't care of the order of the chapters told by EAGLE.
Also OWL is always hungry and need to rush for lunch so, OWL counts a chapter correct, even if the Story Name for a corresponding chapter number is jumbled.
But, if a Story Name (same or jumbled) gets mixed with another Chapter Number, it is said to be wrong.

After EAGLE completes writing all the chapters, You need to calculate number of mistakes committed by him.

Standard Input:
Each input contains 2*N + 1 lines. First line contains N, representing number of chapters.
Next N Lines contains chapters taught by OWL by a integer X and a string S.
X -> Chapter number
S -> Chapter Name

Next N lines contains the answer written by EAGLE containg integer X and string S.
X-> Chapter number.
S-> Chapter Name.


Standard Output:
Print a single integer denoting number of mistakes done by EAGLE.

Constraints:
1<=n<=100
1<=Length of story name (consisting of small character only (a-z) ) <=100

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

In first N+1 lines Owl taught two chapters with correspoding Story Name. Next,
In first line, Eagle wrote chapter
2 shauy
which is chapter 2 corresponding to its name "ayush" (as jumbled), which is correct
In second line, Eagle wrote chapter
1 eermss
which is chapter 1 corresponding to "sameer",
SInce it can't be rearranged to correct Story name, it is Incorect. So answer is 1 .

Editor Image

?