#include <bits/stdc++.h>
using namespace std;
const int N= 3e5;
map<int, int>mp;
int main() {
// your code goes here
int n, m;
cin>>n>>m;
for (int i = 0; i<n; ++i) {
int x;
cin>>x;
mp[x]++;
}
if (mp[m] == 0)
puts("0");
else if (mp[m] % 2 == 0)
cout<<mp[m]-1<<endl;
else
cout<<mp[m]<<endl;
return 0;
}