n = int(input()) a = [int(input()) for i in range(n)] a.sort() for i in range(n-1): if a[i+1]-a[i] <= 1: print(2) exit() print(1)