n=int(input()) t=sorted(int(input()) for _ in range(n)) ans=1 for i in range(1,n): if t[i]-t[i-1]==1: ans=2 break print(ans)