N=int(input()) A=[int(input()) for i in range(N)] A=sorted(A) d=0 for i in range(N-1): if A[i]+1==[i+1]: print(2) exit() print(1)