365_A. Good Number
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 ai without leading zeroes (1 ≤ ai ≤ 109).

Output

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

Examples

Input

10 6
1234560
1234560
1234560
1234560
1234560
1234560
1234560
1234560
1234560
1234560


Output

10


Input

2 1
1
10


Output

1
```python
import sys
x=input().split()
n=int(x[0])
k=int(x[1])
list=[]
for i in range(0,n):
    y=input()
    list.append(y)
l=0
for j in list:
    flag=1
    for z in range(0,k+1):
        if str(z) not in j:
            flag=0
            break
    if flag==1:
        l=l+1

print(l)
```