n = int(input()) cnt0, cnt1 = 0, 0 A = [int(input()) for _ in range(n)] A.sort() for a in A: if a % 2 == 0: cnt1 += 1 else: cnt0 += 1 for i in range(n-1): if A[i+1] - A[i] <= 1: if cnt0 and cnt1: print(2) break else: print(1)