Codeforces Round 213 (Div. 2)
A
Good Number
Codeforces
1100
原题
←B →
翻译中…

Let's call a number $*k*$-good if it contains all digits not exceeding $*k*$ ($0, ..., *k*$). You've got a number $*k*$ and an array $*a*$ containing $*n*$ numbers. Find out how many $*k*$-good numbers are in $*a*$ (count each number every time it occurs in array $*a*$).

翻译中…

Input

翻译中…

The first line contains integers $*n*$ and $*k*$ ($1 ≤ *n* ≤ 100$, $0 ≤ *k* ≤ 9$). The $*i*$-th of the following $*n*$ lines contains integer $*a*_{*i*}$ without leading zeroes ($1 ≤ *a*_{*i*} ≤ 10^{9}$).

翻译中…

Output

翻译中…

Print a single integer — the number of $*k*$-good numbers in $*a*$.

翻译中…

样例

Input #1
10 6
1234560
1234560
1234560
1234560
1234560
1234560
1234560
1234560
1234560
1234560
Output #1
10
InputCopy OutputCopy
Input #2
2 1
1
10
Output #2
1
InputCopy OutputCopy
题目信息
题号
365A
时间限制
1 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。