# AtCoder Regular Contest 068

URL: https://atcoder.jp/contests/arc068 (opens new window)

# D

n = gets.chomp.to_i
a_arr = gets.chomp.split(" ").map(&:to_i)

hash = {}
a_arr.each do |a|
  hash[a] ||= 0
  hash[a] += 1
end

count = 0
even_num = 0
hash.each do |k, v|
  count += 1
  even_num += 1 if v % 2 == 0
end

if even_num % 2 == 1
  count -= 1
end

puts count
Last Updated: 2020/08/09 18:33