#include <bits/stdc++.h>
using namespace std;
int n, k, ans;
map<int, int> m;
int main() {
  scanf("%d%d", &n, &k);
  k = (n + 1) / 2;
  for (int i = 0; i < n; i++) {
    int tmp;
    scanf("%d", &tmp);
    m[tmp]++;
  }
  for (auto& i : m) {
    int tmp = i.second / 2;
    ans += tmp;
    k -= tmp;
  }
  ans = ans * 2 + k;
  printf("%d\n", min(n, ans));
}
