#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, k, temp;
  cin >> n >> k;
  map<int, int> cnt;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    cnt[temp]++;
  }
  int goods;
  int bads;
  int ans;
  ans = goods = bads = 0;
  for (auto it : cnt) {
    bads += it.second % 2;
    goods += it.second / 2 * 2;
  }
  ans = goods + (bads + 1) / 2;
  cout << ans << endl;
  return 0;
}
