#include <iostream>
using namespace std;
int main() {
int x, n, liczba, ile;
while(cin >> x) {
ile = 0;
cin >> n;
for(int i=0;i<n;i++) {
cin >> liczba;
if(liczba==x) ile++;
}
cout << ile << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CgkKCWludCB4LCBuLCBsaWN6YmEsIGlsZTsKCXdoaWxlKGNpbiA+PiB4KSB7CgkJaWxlID0gMDsKCQljaW4gPj4gbjsKCQlmb3IoaW50IGk9MDtpPG47aSsrKSB7CgkJCWNpbiA+PiBsaWN6YmE7CgkJCWlmKGxpY3piYT09eCkgaWxlKys7CgkJfQoJCWNvdXQgPDwgaWxlIDw8IGVuZGw7Cgl9CgoJcmV0dXJuIDA7Cn0=