n = int(input()) a = list(map(int, input().split())) a.sort() median = a[(n - 1) // 2] count = sum(1 for x in a if x > median) print(count)