import std.algorithm;
import std.array;
import std.container;
import std.conv;
import std.range;
import std.stdio;
import std.string;


void main() {
    readln;
    auto input = readln.chomp.split.map!(to!int).array;
    auto set = new RedBlackTree!int(input);
    auto cards_num = input.length;
    auto kinds_num = set.length;
    (kinds_num - (cards_num - kinds_num) % 2).writeln;
}