_ = int(input()) numbers = list(map(int, input().split())) numbers.sort() flag = 0 counter = 0 for i, num in enumerate(numbers[:-1]): if num != numbers[i+1] and flag != numbers[i]: counter += 1 else: flag = num if flag != numbers[-1]: counter += 1 print(counter)