From the word "moloko", you can form the word "kolo". Given a word and a dictionary, determine how many words in the dictionary can be formed using the letters from the given word, with each letter used at most once.
The first line contains the given word.The second line contains an integer — the number of words in the dictionary.The next lines each contain a word from the dictionary.
Print a single integer: the number of dictionary words that can be formed from the given word.
Example 5
The words "kolo" and "oko" can be formed from the letters of "moloko", but "koma" cannot.