#include <bits/stdc++.h>
using namespace std;
int main(){
int n,d;
cin>>n>>d;
vector<int> a(n);
map<int,int> freq;
for(int i =0; i<n; i++){
cin>>a[i];
freq[a[i]]++;
}
int k = freq[d];
if(d == 0){
cout<<freq[d]<<endl;
return 0;
}
if(k && k%2==0)
k--;
cout<<k<<endl;
return 0;
}