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