def main(): from sys import stdin readline=stdin.readline n = int(readline()) cnt0, cnt1 = 0, 0 A = [] for i in range(n): a = int(readline()) A.append(a) if a % 2 == 0: cnt1 += 1 else: cnt0 += 1 A.sort() flag = False for i in range(n-1): if A[i+1] - A[i] <= 1: flag = True break if flag: if cnt0==0 or cnt1==0: ans = 1 else: ans = 2 else: ans = 1 print(ans) main()