// review
#include <iostream>
#include <set>

using namespace std;

int n;
set<int> s;

void solve() {
  if (s.size() % 2 == 0) {
    cout << s.size() - 1 << endl;
  } else {
    cout << s.size() << endl;
  }
}

int main() {
  cin >> n;
  int tmp;
  for (int i=0;i<n;i++) {
    cin >> tmp;
    s.insert(tmp);
  }
  solve();
}
