N, *A = map(int, open(0))

A.sort()

if all(a + 1 < b for a, b in zip(A, A[1:])):
    print(1)
else:
    print(2)