The Ninjanet of Ninjaland has N websites. The name of all websites is in the form of a string and all of them have a length equal to M. Ayush is searching for his favourite website but unfortunately, he forgot some of the characters of the website so he replaced those characters with ‘?’. Your task is to calculate the number of websites that can possibly be a favourite of Ayush.
For example:
There are three websites in Ninjanet that are: "abc", "aba" and "aac".
If Ayush searches for “ab?” then there will be 2 websites that could be a favourite of Ayush, which are "abc" and "aba".
If Ayush searches for “?a?” then there will be only 1 website that could be a favourite of Ayush, i.e. "aac".
Input format :
The first line of input contains three space-separated integers N, M and Q, denoting the number of websites, length of each website and number of queries respectively.
Next, the N line contains a single string, where the ith line consists of the name of the ith website in the Ninjanet.
Next, the Q line contains a query string, the name of the favourite website of Ayush with certain ‘?’ characters (Possibly 0), as described in the problem statement.
Output format :
For each query, print a single integer on a newline, denoting the number of websites that can possibly be Ayush’s favourite website.
Note :
You do not need to print anything, it has already been taken care of. Just implement the given function.
Constraint :
1 <= N <= 10^4
1 <= M <= 6
1 <= Q <= 10^5
Time Limit: 1 sec