跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F2259. Good Number

    ID: 2265 传统题 2000ms 256MiB 尝试: 0 已通过: 0 难度: 2 上传者: 标签>模拟编程与模拟基础难度共享题库Codeforces英文题面题目来源题面语言

Good Number

题目描述

A. Good Number
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

题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 1868 题。保留原作者与原赛事署名。