Words
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
From the word "moloko", you can create the word "kolo" How many words from the provided dictionary can be constructed using the letters from the original word, with each letter used no more than once?
Input
The first line contains the original word.
The second line contains the number N, representing the number of words in the dictionary.
The next N lines each contain a word from the dictionary.
Output
A single number indicating how many words can be formed from the original word.
Examples
Input #5
Answer #5
Submissions 4K
Acceptance rate 31%