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