n = int(input()) a = list(map(int,input().split())) a.sort() cnt=0 for i in range(n): if i != 0: if a[i] == a[i-1]: continue if i != n-1: if a[i] == a[i+1]: continue cnt+=1 print(cnt)