Important Messages

시간 제한1초메모리 제한1024 MB

요약
연락처 이메일 목록과 메시지 발신자 주소가 주어질 때, 연락처에 있는 발신자가 보낸 메시지 수를 센다.
난이도

쉬움10점 중 3점

유형
해시맵, 문자열, 구현
정답자
아직 제출이 없습니다

문제

These days one may get hundreds of email messages a day. Of course, nobody can read so many of them. Thus Juku wants to highlight messages whose senders are in his contact list.

Write a program that gets Juku's contact list and the senders of his email messages and counts, how many of those messages should be highlighted.

입력

The first line of input contains NN, the number of entries in Juku's contact list (1≤N≤1,0001 \le N \le 1\\,000), and each of the following NN lines one email address of 1 to 50 characters.

The next line of the file contains MM, the number of messages (1≤M≤10,0001 \le M \le 10\\,000), and each of the following MM lines the sender address of one message, again 1 to 50 characters.

The characters in an email address can be lower-case letters (a…\dotsz), digits (0…\dots9), dots (.) and at-signs (@).

출력

The only line of output should contain one integer: the number of messages to be highlighted.

예제1

  1. 예제 1

    입력
    3
    kati@eesti.ee
    lauri@arvuti.net
    mati@eesti.ee
    4
    unknown@somewhere.com
    robot@spam.com
    kati@eesti.ee
    mati@xxx.org
    
    예상 출력
    1