AKOJ正在加载中...

3465: Good Number

金币值:2 定数:1 时间限制:2.000 s 内存限制:256 M
正确:0 提交:0 正确率:0.00% 命题人:
点赞量:0 收藏量:0 题目类型:程序

题目描述

time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

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