N=int(input()) A=[int(input()) for i in range(N)] A.sort() TWO=False for i in range(N-1): if A[i]+1==A[i+1]:TWO=True print(2 if TWO else 1)