import std.algorithm;
import std.array;
import std.ascii;
import std.container;
import std.conv;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.typecons;
void log(A...)(A arg) { stderr.writeln(arg); }
int size(T)(in T s) { return cast(int)s.length; }

void main() {
    int n = readln.chomp.to!int;
    auto as = readln.chomp.split(" ").map!(to!int).array;
    int[int] count;
    foreach (a; as) {
        count[a] = count.get(a, 0) + 1;
    }
    auto cs = count.values();
    int r = 0;
    foreach (c; cs) {
        r += max(0, c - 1);
    }
    int eat = (r + 1) / 2 * 2;
    writeln(n - eat);
}
