N=int(input()) A=sorted([int(input()) for i in range(N)]) ans=1 for i in range(1,N): if A[i]-A[i-1]==1: ans+=1 print(ans)