K. Keypad Repetitions
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

A telephone keypad is a keypad installed on a push-button telephone or similar telecommunication device which usually contains $$$10$$$ keys, each of which represents a digit used to dial a telephone number. Today most telephones have an integrated memory, this memory allows users to store common used telephone numbers using a string identifier making it easier for the user to dial numbers without the need of having it memorized or stored in a paper agenda. In order for users to store the string identifier the keypad associates letters to some of the key digits, traditionally this is named as "letter mapping" and the most common one is shown in the following table:

DigitLetters
2abc
3def
4ghi
5jkl
6mno
7pqrs
8tuv
9wxyz

Using this "letter mapping" the user could store the string to identify a telephone number using the keypad, for example, to store the identifier "jhon" the user can press the keypad in the following order: "5466". One problem of this approach is that several identifiers can be represented pressing the keypad in the same order, for example, "5466" that can be used to represent "jhon", can represent also "kino".

Jaime has a list of $$$N$$$ identifiers to be stored in his grandfathers old telephone, they suspect a lot of these identifiers can be represented with the same numbers, however, they have not been able to verify their claim, that is why they asked for your help to given the list of identifiers and a set of $$$Q$$$ keypad presses to query, find how many identifiers of the list can be represented with each of the keypad presses.

Input

The first line of input contains two integer numbers $$$N$$$ ($$$1 \leq N \leq 10^5$$$) and $$$Q$$$ ($$$1 \leq Q \leq 10^5$$$), representing the number of identifiers in the list and the number of keypad presses to query. Each of the next $$$N$$$ lines contains one of the strings of the list of identifiers, each string consists only of lowercase english alphabet letters and have a length between 1 and 10 characters. Each of the next $$$Q$$$ lines contains a keypad press to query, each of the keypad presses contains between 1 and 10 digits between 2 and 9.

Output

For each query in the input print a line with a single integer, representing the number of identifiers in the list that can be represented using the keypad presses in the query.

Example
Input
4 5
jhon
abcde
a
kino
5466
2
22233
2222
5466
Output
2
1
1
0
2