#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, k, t, d = 0, r = 0;
  vector<int> v;
  cin >> n >> k;
  v.push_back(0);
  for (i = 0; i < n; i++) {
    cin >> t;
    v.push_back(t);
  }
  sort(v.begin(), v.end());
  d = 0;
  if (n % 2 == 1) {
    for (i = 1; i <= n && d <= (n / 2); i++) {
      if (v[i] == v[i + 1]) {
        v[i] = 0;
        v[i + 1] = 0;
        d += 1;
        i += 1;
      }
    }
    if (d == (n / 2)) {
      cout << n;
    } else {
      for (i = 1; i < n + 1; i++) {
        if (v[i] == 0) r += 1;
      }
      r += 1;
      d += 1;
      r += ((n / 2) + 1) - d;
      cout << r;
    }
  } else {
    for (i = 1; i <= n; i++) {
      if (v[i] == v[i + 1]) {
        v[i] = 0;
        v[i + 1] = 0;
        d += 1;
        i += 1;
      }
    }
    if (d < (n / 2)) {
      for (i = 1; i < n + 1; i++) {
        if (v[i] == 0) r += 1;
      }
      r += (n / 2) - d;
      cout << r;
    } else
      cout << n;
  }
  return 0;
}
