Under construction

Still being built. Things may change

Important Messages

Time limit1sMemory limit1024 MB

Summary
Count how many message sender addresses appear in a given contact list of email addresses.
Level

Easy2 of 10

Topics
Hash map, String
Solved
No attempts yet

Problem

Juku receives hundreds of email messages a day. Nobody can read so many of them, so Juku wants to highlight the messages whose senders are in his contact list.

Write a program that reads Juku's contact list and the sender addresses of his messages, then counts how many of those messages should be highlighted.

Input

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

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

An email address consists of lower-case letters (a…\dotsz), digits (0…\dots9), dots (.), and at-signs (@).

Output

Print one integer: the number of messages to be highlighted.

Examples1

  1. Example 1

    Input
    3
    kati@eesti.ee
    lauri@arvuti.net
    mati@eesti.ee
    4
    unknown@somewhere.com
    robot@spam.com
    kati@eesti.ee
    mati@xxx.org
    
    Expected output
    1