#include <iostream>
#include <vector>
using namespace std;
int main(){
int n, d;
cin >> n >> d;
int cnt = 0;
for(int i = 0; i < n; ++i){
int t; cin >> t;
if( t == d ) cnt += 1;
}
if((cnt&1) == 0 && cnt && d != 0)
cnt -= 1;
cout << cnt << endl;
return 0;
}