You have $N$ rings. On each ring, a string consisting of $10$ uppercase English letters is engraved. The characters are engraved on the ring such that the beginning and the end of the string are connected. There is no need to worry about reading the string engraved on a ring in reverse order.
Given a string to search for, write a program to find how many rings contain that string.
Input
The input consists of $2+N$ lines.
The $1$-st line contains the string to search for, consisting of at least $1$ and at most $10$ uppercase English letters.
The $2$-nd line contains the number of rings $N$ ($1 \le N \le 100$).
Line $2+i$ ($1 \le i \le N$) contains the $10$-character string engraved on the $i$-th ring.
Output
Output on $1$ line an integer representing the number of rings that contain the string to search for.
Examples
Input 1
ABCD 3 ABCDXXXXXX YYYYABCDXX DCBAZZZZZZ
Output 1
2
Input 2
XYZ 1 ZAAAAAAAXY
Output 2
1
Input 3
PQR 3 PQRAAAAPQR BBPQRBBBBB CCCCCCCCCC
Output 3
2
Note
The ring in Sample Input $2$ contains $1$ occurrence of the string XYZ. This is because the beginning and the end of the string on the ring are connected.
In Sample Input $3$, the $1$-st ring contains $2$ occurrences of the string PQR, the $2$-nd ring contains $1$ occurrence of the string PQR, and the $3$-rd ring does not contain the string PQR. Therefore, the number of rings containing the string PQR is $2$.