import std.stdio, std.string, std.conv, std.algorithm, std.range, std.typecons;

void main() {
    auto N = readln.chomp.to!int;
    auto A = readln.split.to!(int[]);
    auto B = A.sort().group().map!(a => a).array;
    auto kind = B.length;
    assert(N % 2 == 1);
    if (kind % 2 == 0) {
        writeln(kind-1);
    } else {
        writeln(kind);
    }
}