#include <iostream>

using namespace std;

int main() {
	int N;
	int A[100000];
	int count[100000] = {};
	int d = 0;

	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		count[A[i]]++;
		if (count[A[i]] > 1)	d++;
	}
	if (d % 2 == 1)	d++;
	cout << N - d << endl;

	return 0;
}