N=int(input()) p=[int(input()) for i in range(N)] def f(p): p.sort() for i in range(N-1): if p[i+1]==p[i]+1: return 2 return 1 print(f(p))