#Q59. 「一本通 2.4 例 1」Keywords Search

「一本通 2.4 例 1」Keywords Search

Description

Original problem from: HDU 2222

Given nn words to query, each with a length not exceeding 50 and composed of lowercase English letters, and an article of length mm, determine how many of the query words appear in the article. There are multiple test cases.

Input Format

The first line contains an integer TT, representing the number of test cases. For each test case, the first line contains an integer nn, followed by nn lines each representing a word. The last line contains a string representing the article.

Output Format

For each test case, output a number indicating how many of the query words appear in the article.

Sample 1

1
5
she
he
say
shr
her
yasherhs

3

Data Range and Hint

For all data, 1n104,1m1061\le n\le 10^4,1\le m\le 10^6.