#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<int> cnt(1001, 0);
  for (int i = 0; i < n; i++) {
    cnt[a[i]]++;
  }
  vector<int> poss;
  for (int i = 1; i <= 1000; i++) {
    if (cnt[i]) poss.push_back(i);
  }
  sort(poss.begin(), poss.end());
  reverse(poss.begin(), poss.end());
  int i = 1, j = 0, ans = 0;
  for (; i <= (n + 1) / 2 && j < poss.size(); j++) {
    while (cnt[poss[j]] >= 2 && i <= (n + 1) / 2) {
      cnt[poss[j]] -= 2;
      ans += 2;
      i++;
    }
  }
  if (i <= (n + 1) / 2) ans += (n + 1) / 2 - i + 1;
  cout << ans << endl;
  return 0;
}
