n = int(input()) a = sorted([int(input()) for _ in range(n)])[::-1] if a[0] > a[1]+1: print(1) else: print(2)