#include <bits/stdc++.h>
using namespace std;
long long INF = 1e7;
long long ans = INT_MIN;
long long xx[] = {0, 0, 1, 1, 1, -1, -1, -1};
long long yy[] = {-1, 1, -1, 0, 1, -1, 0, 1};
void solve() {
  long long n, k;
  cin >> n >> k;
  unordered_map<long long, long long> mp;
  long long temp;
  for (long long j = 0; j < n; j++) {
    cin >> temp;
    mp[temp]++;
  }
  long long c = 0;
  for (auto x : mp) {
    if (x.second % 2 != 0) c++;
  }
  c = c / 2;
  cout << n - c;
}
int32_t main() {
  std::ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  {
    solve();
    cout << endl;
  }
}
