#00063E

Reči - Okružno

Little Perica has recently started school and he has already learned how to read. Since Perica is a hard-working and honest student, he asked his teacher for a task where he could test his knowledge. The teacher, happy for having such a good student, immediately gave him a task.


Perica has been given a little dictionary R, containing n words. Besides that, the teacher also gave him a list L containing m words. His task is to test each word out of the list L in the following way: For each word out of the dictionary he must find all of its occurences in the word he's testing and cross out each occurence. In the end, Perica must tell his teacher the amount of words from the list L that have each letter crossed out at least once.


Help the teacher by making a program that determines how many words out of the list L will be completely crossed out, so she could check Perica's work easier.


InputIn the first line of the standard input an integer n (1 ≤ n ≤ 100), the number of words in the dictionary R, is located. In the following line, n words that make up the dictionary are located. The words are separated by a space and their length doesn't exceed 10 characters. In the third line, the number m (1 ≤ m ≤ 100), representing the amount of words in the list L, is located. The following m lines will contain one word from the list L each. Each word will not exceed 100 characters in length. All characters are lowercase letters from the English alphabet.

OutputIn the first and only line of the standard output write the amount of completely crossed out words from the list.

Input:
6
paja ram papa ma lama lig
7
papaja
salama
papaje
ramalama
mara
mama
miligram

Output:
3
Explanation: There are three completely crossed out words: papaja, ramalama, mama.

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.