A = sorted([int(input()) for _ in range(int(input()))]) print([2, 1][all(A1 + 1 < A2 for A1, A2 in zip(A, A[1:]))])