AT_past202209_g Wildcards

Description

Let $ S $ be a string consisting of lowercase English letters and $ T $ be a string consisting of lowercase English letters and `?`. $ S $ is said to be *obtainable from* $ T $ when one can replace each occurrence of `?` in $ T $ with some lowercase English letter so that $ T $ equals $ S $ . For example, `abcd` and `addd` are obtainable from `a??d`, while `bcdd` is not. You are given $ N $ strings $ S_1, S_2, \ldots, S_N $ consisting of lowercase English letters. All of these strings have a length of $ L $ : $ |S_1| = |S_2| = \cdots = |S_N| = L $ . A string $ T $ of length $ L $ consisting of lowercase English letters is arbitrarily chosen so that it **contains exactly $ K $ `?`s**. Find the maximum possible number of strings among $ S_1, S_2, \ldots, S_N $ that are obtainable from $ T $ .

Input Format

Input is given from Standard Input in the following format: > $ N $ $ L $ $ K $ $ S_1 $ $ S_2 $ $ \vdots $ $ S_N $

Output Format

Print the answer.

Explanation/Hint

### Sample Explanation 1 If we let $ T = $ `a?b?`, then $ S_1 = $ `aabc`, $ S_3 = $ `abbc`, and $ S_5 = $ `acba` are obtainable from $ T $ . Here, three of the strings $ S_1, S_2, \ldots, S_N $ are obtainable from $ T $ , which is the maximum possible number. Note that $ K = 2 $ , so $ T $ must be chosen to contain exactly two `?`s. ### Sample Explanation 2 If we let $ T = $ `????`, all of $ S_1, S_2, S_3, S_4, S_5 $ are obtainable from $ T $ . ### Constraints - $ 1 \leq N \leq 1000 $ - $ 1 \leq L \leq 10 $ - $ 0 \leq K \leq L $ - $ N $ , $ L $ , and $ K $ are integers. - Each of $ S_1, S_2, \ldots, S_N $ is a string of length $ L $ consisting of lowercase English letters. - $ S_1, S_2, \ldots, S_N $ are distinct.