#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> pica(n);
  for (int i = 0; i < n; ++i) {
    cin >> pica[i];
  }
  int m;
  if (n % 2 == 0)
    m = n / 2;
  else
    m = n / 2 + 1;
  int dobili_pice = 0;
  sort(pica.begin(), pica.end());
  for (int i = 0; i < pica.size() - 1; ++i) {
    if (pica[i] == pica[i + 1]) {
      dobili_pice += 2;
      ++i;
      m--;
    }
  }
  dobili_pice += m;
  cout << dobili_pice << endl;
  return 0;
}
