n = int(input()) a = [int(input()) for i in range(n)] a = sorted(a) ans = 1 for i in range(n-1): if a[i] + 1 < a[i+1]: pass else: ans = 2 break print(ans)