N=int(input()) A=list(map(int,input().split())) count=0 A.sort() 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 count+=1 print(count)