N=int(input()) if N==1: print(1) else: A=[0]*N for i in range(N): A[i]=int(input()) A=sorted(A) for i in range(N-1): if A[i+1]-A[i]==1: print(2) exit() print(1)