#include <bits/stdc++.h>
using namespace std;
int n, k, a[1005];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    a[x]++;
  }
  int cnt = 0, ans = 0;
  for (int i = 1; i <= k; i++) {
    int j = a[i] / 2;
    cnt += j;
    ans += (j << 1);
  }
  cout << ans + ((n + 1) / 2) - cnt << endl;
  return 0;
}
