#your code goes here #new N=int(input()) A=[int(i)for i in input().split()] A.sort() C=0 if A[0]!=A[1]: C+=1 for i in range(1,N-2): if A[i]!=[i-1] and A[i]!=[i+1]: C+=1 if A[i-2]!=A[i-1]: C+=1 print(C)