from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf

from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement

from collections import deque,defaultdict,Counter

from bisect import bisect_left,bisect_right

from operator import itemgetter

from heapq import heapify,heappop,heappush

from queue import Queue,LifoQueue,PriorityQueue

from copy import deepcopy

from time import time

import string

import sys

sys.setrecursionlimit(10 ** 7)

def input() : return sys.stdin.readline().strip()

def INT()   : return int(eval(input()))

def MAP()   : return list(map(int,input().split()))

def LIST()  : return list(MAP())



n = INT()

a = Counter(LIST())



tmp = 0

f = False

for x in a:

  while a[x] > 1:

    if a[x] == 2:

      a[x] -= 1

      if f:

        f = False

      else:

        tmp += 1

        f = True

    else:

      a[x] -= 2

      tmp += 1

ans = n - tmp*2      

print(ans)
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf

from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement

from collections import deque,defaultdict,Counter

from bisect import bisect_left,bisect_right

from operator import itemgetter

from heapq import heapify,heappop,heappush

from queue import Queue,LifoQueue,PriorityQueue

from copy import deepcopy

from time import time

import string

import sys

sys.setrecursionlimit(10 ** 7)

def input() : return sys.stdin.readline().strip()

def INT()   : return int(eval(input()))

def MAP()   : return list(map(int,input().split()))

def LIST()  : return list(MAP())



n = INT()

a = Counter(LIST())

ans = len(a) if len(a) % 2 == 1 else len(a) - 1

print(ans)
from math import (
    ceil,
    floor,
    factorial,
    gcd,
    sqrt,
    log2,
    cos,
    sin,
    tan,
    acos,
    asin,
    atan,
    degrees,
    radians,
    pi,
    inf,
)
from itertools import (
    accumulate,
    groupby,
    permutations,
    combinations,
    product,
    combinations_with_replacement,
)
from collections import deque, defaultdict, Counter
from bisect import bisect_left, bisect_right
from operator import itemgetter
from heapq import heapify, heappop, heappush
from queue import Queue, LifoQueue, PriorityQueue
from copy import deepcopy
from time import time
import string
import sys

sys.setrecursionlimit(10**7)


def input():
    return sys.stdin.readline().strip()


def INT():
    return int(eval(input()))


def MAP():
    return list(map(int, input().split()))


def LIST():
    return list(MAP())


n = INT()
a = Counter(LIST())
tmp = 0
f = False
for x in a:
    while a[x] > 1:
        if a[x] == 2:
            a[x] -= 1
            if f:
                f = False
            else:
                tmp += 1
                f = True
        else:
            a[x] -= 2
            tmp += 1
ans = n - tmp * 2
print(ans)

from math import (
    ceil,
    floor,
    factorial,
    gcd,
    sqrt,
    log2,
    cos,
    sin,
    tan,
    acos,
    asin,
    atan,
    degrees,
    radians,
    pi,
    inf,
)
from itertools import (
    accumulate,
    groupby,
    permutations,
    combinations,
    product,
    combinations_with_replacement,
)
from collections import deque, defaultdict, Counter
from bisect import bisect_left, bisect_right
from operator import itemgetter
from heapq import heapify, heappop, heappush
from queue import Queue, LifoQueue, PriorityQueue
from copy import deepcopy
from time import time
import string
import sys

sys.setrecursionlimit(10**7)


def input():
    return sys.stdin.readline().strip()


def INT():
    return int(eval(input()))


def MAP():
    return list(map(int, input().split()))


def LIST():
    return list(MAP())


n = INT()
a = Counter(LIST())
ans = len(a) if len(a) % 2 == 1 else len(a) - 1
print(ans)

-tmp = 0 -f = False -for x in a: -    while a[x] > 1: -        if a[x] == 2: -            a[x] -= 1 -            if f: -                f = False -            else: -                tmp += 1 -                f = True -        else: -            a[x] -= 2 -            tmp += 1 -ans = n - tmp * 2 +ans = len(a) if len(a) % 2 == 1 else len(a) - 1