#include <bits/stdc++.h>
using ll = long long;
int main() {
  int n, k;
  std::cin >> n >> k;
  std::vector<int> v(k + 1);
  for (int i{}, x; i < n; ++i) {
    std::cin >> x;
    ++v[x];
  }
  int x{};
  for (auto val : v) {
    x += (val + 1) / 2;
  }
  std::cout << (n - x + (n + 1) / 2) << std::endl;
}
