#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int k;
  cin >> k;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (mp.count(a) == 0) {
      mp.insert({a, 1});
    } else {
      mp[a] = mp[a] + 1;
    }
  }
  map<int, int>::iterator it = mp.begin();
  int count = 0;
  int set_remaing = (n + 1) / 2;
  int max = -1;
  for (; it != mp.end(); it++) {
    if (it->second != 1) {
      set_remaing = set_remaing - (it->second) / 2;
    }
  }
  count = count + 2 * (((n + 1) / 2) - set_remaing);
  cout << count + set_remaing << endl;
}
