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