N = int(input()) A = sorted([int(i) for i in input().split()]) ans = 0 isOnly = True for i in range(N-1): if A[i] == A[i+1]: isOnly = False elif isOnly: ans += 1 if i == N-2: ans+=1 else: isOnly = True print(ans)