#include <iostream>
#include <map>
#include <algorithm>
using namespace std;

int main()
{
    int n;
    cin >>n;
    map <int , int> m;
    int x;
    int counter = 0;
    for (int i=0;i <n;i++) {
        cin >>x;
        if (m[x] > 0) {
            counter++;
        } else {
            m[x]++;
        }
    }
    if (counter % 2 == 1) {
        counter++;
    }
    cout << (n-counter) ;
    return 0;
}
