from collections import defaultdict as dd

from functools import reduce



if __name__ == "__main__":

    N = int(eval(input()))

    arr = list(map(int, input().split()))



    dic = dd(int)



    for el in arr:

        dic[el] += 1



    count = len(dic) - len(list([x for x in list(dic.values()) if x %

                                       2 == 0])) % 2

    print(count)

from collections import Counter

from functools import reduce



if __name__ == "__main__":

    N = int(eval(input()))

    arr = list(map(int, input().split()))



    dic = Counter(arr)

    count = len(dic) - reduce(lambda sum, item: sum + 1, [x for x in list(dic.values()) if x % 2 == 0], 0) % 2

    print(count)

from collections import defaultdict as dd
from functools import reduce

if __name__ == "__main__":
    N = int(eval(input()))
    arr = list(map(int, input().split()))
    dic = dd(int)
    for el in arr:
        dic[el] += 1
    count = len(dic) - len(list([x for x in list(dic.values()) if x % 2 == 0])) % 2
    print(count)

from collections import Counter
from functools import reduce

if __name__ == "__main__":
    N = int(eval(input()))
    arr = list(map(int, input().split()))
    dic = Counter(arr)
    count = (
        len(dic)
        - reduce(
            lambda sum, item: sum + 1, [x for x in list(dic.values()) if x % 2 == 0], 0
        )
        % 2
    )
    print(count)

-from collections import defaultdict as dd +from collections import Counter -    dic = dd(int) -    for el in arr: -        dic[el] += 1 -    count = len(dic) - len(list([x for x in list(dic.values()) if x % 2 == 0])) % 2 +    dic = Counter(arr) +    count = ( +        len(dic) +        - reduce( +            lambda sum, item: sum + 1, [x for x in list(dic.values()) if x % 2 == 0], 0 +        ) +        % 2 +    )