#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) { return (a > b) ? a : b; }
int32_t main() {
  long long n, k;
  cin >> n >> k;
  map<long long, long long> have;
  for (long long i = 0; i < n; ++i) {
    long long num;
    cin >> num;
    have[num]++;
  }
  long long cnt = 0;
  long long ans = 0;
  for (auto p : have) {
    cnt += p.second % 2;
    ans += p.second / 2 * 2;
  }
  ans += (cnt + 1) / 2;
  cout << ans << "\n";
  return 0;
}
