def isEven(n):
  if n%2 == 0:
    return True
  else:
    return False

n = int(input())
arr = [int(number) for number in input().split()]
evenNumbers = 0
oddNumbers = 0
oddNumber = 0
evenNumber = 0
for number in arr:
  if isEven(number):
    evenNumbers += 1
    evenNumber = number
  else:
    oddNumbers += 1
    oddNumber = number
if evenNumbers == oddNumbers or evenNumbers+1 == oddNumbers or evenNumbers == oddNumbers+1:
  print(0)
elif evenNumbers > oddNumbers:
  print(evenNumber)
else:
  print(oddNumber)