#include <iostream>
using namespace std;
int main() {
int x,n,a,licz=0;
while(cin>>x){
licz = 0;
cin>>n;
while(n--){
cin>>a;
if(a==x){
licz++;
}
}
cout<<licz<<endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CgkKCWludCB4LG4sYSxsaWN6PTA7Cgl3aGlsZShjaW4+PngpewoJCWxpY3ogPSAwOwoJCWNpbj4+bjsKCQl3aGlsZShuLS0pewoJCQljaW4+PmE7CgkJCWlmKGE9PXgpewoJCQkJbGljeisrOwoJCQl9CgkJCQoJCX0KCQljb3V0PDxsaWN6PDxlbmRsOwoJfQoJcmV0dXJuIDA7Cn0=