Keywords Search
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 60380 Accepted Submission(s): 19897
Problem Description
In the modern time, Search engine came intothe life of everybody like Google, Baidu, etc.
Wiskey also wants to bring this feature to his image retrieval system.
Every image have along description, when users type some keywords to find the image, thesystem 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.
Input
First line will contain oneinteger means how many cases will follow by.
Each case will contain two integers N means thenumberof keywords and N keywords follow. (N <= 10000)
Each keyword will only containscharacters'a'-'z', andthelength will be not longer than 50.
The lastline is the description, andthelength will be not longer than 1000000.
Output
Print how many keywords are contained inthe description.
Sample Input
15
she
he
say
shr
her
yasherhs
Sample Output
3