#include <iostream>
using namespace std;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int dup = 0;
  bool exist[100001] = {};
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (exist[a]) dup++;
    else exist[a] = 1;
  }
  cout << n - dup - dup % 2 << endl;
  return 0;
}