N = int(input()) A = [int(input()) for _ in range(N)] A.sort() ans = 1 for i in range(N-1): if A[i]+1==A[i+1]: ans = 2 break print(ans)