#include <bits/stdc++.h>
#define int long long
#define f first
#define s second
#define pb push_back
#define endl "\n"
#define SORT(v) sort(begin(v), end(v))
#define np string::npos
#define mnn *min_element
#define mxx *max_element
#define all(v) v.begin(),v.end()
using namespace std;
// struct CustomComparator {
// bool operator()(const pair<int, int>& a, const pair<int, int>& b) const {
// if (a.first != b.first) {
// return a.first < b.first; // First non-decreasing
// } else {
// return a.second > b.second; // Second non-increasing
// }
// }
// };
int32_t main(){ ios::sync_with_stdio(false);cin.tie(0);
int tt;
tt=1;
// cin >> tt;
while(tt--){
int n,d,x; cin>>n>>d;
int ctr=0;
for(int i=0;i<n;i++){
cin>>x;
if(x==d) ctr++;
}
if(d==0) cout<<ctr<<endl;
else if(ctr%2==0 && ctr>0) cout<<ctr-1<<endl;
else cout<<ctr<<endl;
}
}
Copy