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