Count how many dictionary words map letter by letter to the given T9 digit string.
Easy2StringHash mapInterviewNo attempts yetTime limit2sMemory limit64 MBMarko found a new feature on his mobile phone, T9 input. The phone has a numeric keypad laid out like this.

| Key | Letters |
|---|---|
| 2 | a, b, c |
| 3 | d, e, f |
| 4 | g, h, i |
| 5 | j, k, l |
| 6 | m, n, o |
| 7 | p, q, r, s |
| 8 | t, u, v |
| 9 | w, x, y, z |
To type a word on this keypad you press the same key several times until the letter you want appears. If the letter is the first one on the key, one press is enough; if it is the second, you press twice, and so on. To type giht you press 4 for g, 444 for i, 44 for h, and 8 for t. With the feature Marko found you no longer need several presses per letter, just one, and the software works out which dictionary word you meant.
Marko distrusts technology that is new to him and expects errors to be common. He decided to test that hypothesis himself. He knows the whole phone dictionary by heart. The dictionary holds N words made of lowercase English letters, and the total length of the words is at most 1000000. Given a string of key presses S of length at most 1000, count how many dictionary words match S under T9 input.
The first line contains the integer N, the number of words in the dictionary. (1≤N≤1000)
Each of the next N lines contains one word. Every word consists of lowercase English letters, and the total length of all words is at most 1000000.
The last line contains the string S consisting of the digits 2 to 9. (1≤∣S∣≤1000)
Print the number of dictionary words that can be spelled using only the letters on the keys given by S.
In the first example, mono is the only word whose letters all sit on key 6.
In the second example, the first letter of both words is on key 5 and the second letter of both words is on key 2.