#include <iostream>
using namespace std;
int main()
{
int n,a,c;
cout<<"n= ";cin>>n;
cout<<"c= ";cin>>c;
int s=0;
for (int i=1;i<=n;i++)
cin>>a;
while (a)
if (a%10==c)
s++;
break;
}
a\=10;
cout<<s;
return 0;