TUNNEL | 프로그래밍의 벗 PivotOJ
PivotOJ

TUNNEL

시간 제한: 2000ms메모리 제한: 128MB출처: CHC 2002 National Competition #1 - SeniorsBOJ 2002

문제

Mirko stands at the entrance and Slavko stands at the exit of the tunnel. They note the registration plates of cars that pass by them and provide that information to police patrol that is a few miles down the road. 

Using the information that Mirko and Slavko gave them, police can determine, without making mistake, that some drivers made an overtake while driving through the tunnel, which is strictly forbidden. 

Write a program that will determine number of drivers for which the police can certainly claim that they made an overtake. 

We assume that traffic through the tunnel was without any stops. 

입력

Input file consist of 2N+1 lines. 

In first line there is an integer N, 1 ≤ N ≤ 1000, number of cars. 

In next N lines there are registration plates of those cars, in order they entered the tunnel. 

In next N lines there are registration plates of those cars, in order they exit the tunnel. 

Registration plate of some car consists of at least six and at most eight characters and only allowed characters are capital letters of English alphabet (A-Z) and digits of decimal number system (0-9).

출력

First and only line of output file should be the number of drivers who police can certainly punish for making overtake in the tunnel. 

예제

예제 1

입력
4
ZG431SN
ZG5080K
ST123D
ZG206A
ZG206A
ZG431SN
ZG5080K
ST123D
출력
1

예제 2

입력
5
ZG508OK
PU305A
RI604B
ZG206A
ZG232ZF
PU305A
ZG232ZF
ZG206A
ZG508OK
RI604B
출력
3

예제 3

입력
5
ZG206A
PU234Q
OS945CK
ZG431SN
ZG5962J
ZG5962J
OS945CK
ZG206A
PU234Q
ZG431SN
출력
2
코드를 제출하려면 로그인하세요.