N = int(input()) a = [0] a.extend(list(map(int, input().split()))) a.sort() a.append(10**12) i = 0 ans = 0 if N == 1: ans = 1 else: for i in range(1, N+1): if a[i-1] < a[i] < a[i+1]: ans += 1 print(ans)