Passport Checking
InterviewTime limit1sMemory limit64 MB
Count how many passport numbers on a check list appear in a list of stolen numbers, counting duplicates each time.
Problem
This task comes from the MH370 stolen passport case.
The Interpol database holds passport numbers reported stolen. You are given more passport numbers to check. Count how many of the numbers on the check list were reported stolen.
Input
The first line contains an integer . ()
Each of the next lines contains one passport number reported stolen.
The next line contains an integer . ()
Each of the next lines contains one passport number to check.
Passport numbers consist of letters and digits only and have length at most 15. Uppercase and lowercase letters are different characters.
Output
Print on the first line how many of the passport numbers to check were reported stolen. If the same number appears several times on the check list, count it once for every appearance.