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

#F2259. Good Number

  • ID: 2265
  • 传统题
  • 2000ms
  • 256MiB
  • 尝试: 0
  • AC · 已通过: 0
  • 教学难度:基础
  • 上传者:
  • 模拟
  • 编程与模拟
  • 基础
  • 难度
  • 共享题库
  • 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 题。保留原作者与原赛事署名。