#include "bits/stdc++.h"
using namespace std;
int main(){
int n,d;
cin>>n>>d;
vector<int> v(n);
for(int i = 0 ;i < n ;i++)
cin>>v[i];
map<int,int> freq;
for(int i = 0 ; i < n; i++)
{
if(v[i] == d)
freq[d]++;
}
if(d == 0)
cout<<freq[d];
else if(freq[d] == 0)
cout<<0;
else
cout<<(freq[d]&1?freq[d]:freq[d]-1);
}