n=int(input()) a=[] for i in range(n): x=int(input()) a.append(x) a.sort() flag=0 for i in range(n-1): if a[i]==a[i+1]-1: flag=1 if flag==0: print(1) else: print(2)