Wang Baobao has a child named Wang Baobao. Wang Baobao has been clever since childhood and likes to look down on his father. One day, he came up with a problem and brought it to Wang Baobao to solve. Naturally, Wang Baobao could not solve it, so he came to ask you for help.
The problem is as follows: Given $N$ strings $S[1] \sim S[N]$, each of length $K$. $S[1][1], S[1][2], S[1][3], \dots, S[1][K]$ $S[2][1], S[2][2], S[2][3], \dots, S[2][K]$ ... $S[N][1], S[N][2], S[N][3], \dots, S[N][K]$
You need to choose a position $W[i]$ from each string, and then output a string according to the following order: Step 1: Output the $W[i]$-th character of each string in increasing order of the initial $W[i]$ (if $W[i]$ are the same, then in increasing order of $i$). Step 2: Repeat Step 1 $K$ times.
For example: $S[1] = \text{abcde}$ $S[2] = \text{fghij}$ $S[3] = \text{zzzzz}$ $W[1] = 2, W[2] = 0, W[3] = 0$ Then, the output string is: $\text{fzcgzdhzeizajzb}$
Now, our problem is: given $N$, $K$, and these $N$ strings, how many ways are there to choose $W[i]$ such that the final output string is equal to $T$?
Input
The first line contains $N$ and $K$, as described in the problem. The second line contains a string $T$, representing the target string. It is guaranteed that the length of $T$ is equal to $N \times K$. The next $N$ lines each contain a string of length $K$, representing $S[1] \sim S[N]$.
Output
A single integer representing the answer.
Examples
Input 1
3 3 abaabaaba aaa aaa bbb
Output 1
8
Note
There are a total of eight cases: $W[1]=0, W[2]=1, W[3]=0$ $W[1]=0, W[2]=2, W[3]=0$ $W[1]=1, W[2]=0, W[3]=0$ $W[1]=2, W[2]=0, W[3]=0$ $W[1]=0, W[2]=2, W[3]=1$ $W[1]=2, W[2]=0, W[3]=1$ $W[1]=1, W[2]=2, W[3]=1$ $W[1]=2, W[2]=1, W[3]=1$
Constraints
| Case | $N$ | $K$ | Ans |
|---|---|---|---|
| 1 | $\le 5$ | $\le 15$ | \ |
| 2 | |||
| 3 | $10$ | $\le 2000000$ | |
| 4 | |||
| 5 | |||
| 6 | |||
| 7 | $\le 15$ | $\le 20000000$ | |
| 8 | |||
| 9 | \ | ||
| 10 |