#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, a[1010];
  map<int, int> cnt;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i], cnt[a[i]]++;
  int good = 0, bad = 0;
  for (auto c : cnt) {
    good += (c.second / 2) * 2;
    if (c.second & 1) {
      bad++;
    }
  }
  cout << good + (bad + 1) / 2 << "\n";
  return 0;
}
