#include <bits/stdc++.h>
using namespace std;
int a[1010];
int main() {
  int n, k, num = 0, ans = 0;
  cin >> n >> k;
  int t;
  for (int i = 1; i <= n; i++) {
    cin >> t;
    a[t]++;
    if (a[t] == 2)
      ans += 2, --num, a[t] = 0;
    else
      ++num;
  }
  cout << ans + (num + 1) / 2;
}
