N = gets.to_i
md = 10**5+1
d = gets.split.map(&:to_i).sort
cnt = [0]*(md+1)
ans = 0
md.times do |i|
  cnt[i+1] = cnt[i]
  while (i+1)==d[0]
    cnt[i+1] += 1
    d.shift
  end
  if cnt[i+1] == N/2
    ans += 1
  end
  break if cnt[i+1] > N/2
end
p ans
