N, *A = map(int, open(0).read().split()) A.sort() print([1, 2][A[1] - A[0] == 1] if N > 1 else 1)