N = int(input()) a=[] for i in range(N): X = int(input()) a+=[X] a.sort() import sys for i in range(N-1): if a[i+1]==a[i]+1: print(2) sys.exit() print(1)