Summer vacation is coming. Mr.Lin is going to give only one company employee a paid vacation to let him travel. Because of all the employees in the company are very good, It is difficult for Mr.Lin to pick the best. so Mr.Lin came out with a question to his employees to solve. The fast employee who solve this problem can get a paid vacation and go to his life peakness. First, Mr. Lin gives you a string S and then gives you a character list containing n strings, and lets you calculate the number of the string S is good substring. A good substring is defined by this: The string can be found in a substring of all string in the character table. JQ really wants this vacation, so you can help JQ calculate how many good Substring in string S.
让你找主串里面有多少个子串在下面给你的n个串每个串都存在一个子串和主串的子串相等
单组样例主串长度不超过1e5字母表总长度不超过1e5,
一共不超过1e6
There multiple test cases in the input
each test case contains n+2 lines
First line is a string S
Second line is a positive integer n, this is the number in character table.
Next n lines each line contain a string str, this is string in character table.
Input data Guarantee
One line for each test case
A integer means the number of good substring in string S.
aaaaa 1 aaaaa
15