Keywords Search

Keywords Search

Description

给定长度不超过50的由小写英文字母组成的单词,以及一篇长为m的文章,问有多少个单词在文章中出现了。
【英文描述】
In the modern time, Search engine came into the life of everybody like Google, Baidu, etc.
Wiskey also wants to bring this feature to his image retrieval system.
Every image have a long description, when users type some keywords to find the image, the system will match the keywords with description of image and show the image which the most keywords be matched.
To simplify the problem, giving you a description of image, and some keywords, you should tell me how many keywords will be match

Format

Input

第一行一个整数T,表示数据组数。
对于每组数据,第一行一个整数n,接下去n行表示n个单词,最后一行输入一个字符串,表示文章。
【英文描述】
First line will contain one integer means how many cases will follow by.
Each case will contain two integers N means the number of keywords and N keywords follow. (N <= 10000)
Each keyword will only contains characters 'a'-'z', and the length will be not longer than 50.
The last line is the description, and the length will be not longer than 1000000.

Output

对于每组数据,输出一个数,表示有多少个单词在文章中出现。

Sample 1

Input

1
5
she
he
say
shr
her
yasherhs

Output

3

Limitation

1s, 128MiB for each test case.
n<=10^4,m<=10^6

Source

Hdu2222