#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  map<int, int> m;
  int x;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    m[x]++;
  }
  int ans = n / 2;
  if (n % 2) ans++;
  int fans = 0, left = 0;
  for (auto it = m.rbegin(); it != m.rend(); it++) {
    if (ans) {
      int s = it->second / 2;
      s *= 2;
      ans -= it->second / 2;
      fans += s;
      left += it->second % 2;
    }
  }
  while (ans && left) {
    ans--;
    left--;
    fans++;
  }
  cout << fans;
  return 0;
}
