2176: 「一本通 2.4 例 1」Keywords Search

Memory Limit:512 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

**原题来自:[HDU 2222](http://acm.hdu.edu.cn/showproblem.php?pid=2222)** 给定 $n$ 个长度不超过 $50$ 的由小写英文字母组成的单词准备查询,以及一篇长为 $m$ 的文章,问:文中出现了多少个待查询的单词。多组数据。

Input

第一行一个整数 $T$,表示数据组数; 对于每组数据,第一行一个整数 $n$,接下去 $n$ 行表示 $n$ 个单词,最后一行输入一个字符串,表示文章。

Output

对于每组数据,输出一个数,表示文中出现了多少个待查询的单词。

Sample Input Copy

1
5
she
he
say
shr
her
yasherhs

Sample Output Copy

3

HINT


数据范围:对于全部数据,$1\le n\le 10^4,1\le m\le 10^6$。