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