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 cnt0<=1 or cnt1<=1:
    if flag:
      ans = 2
    else:
      ans = 1
  else:
    ans = 2
  print(ans)

main()