import numpy as np def main(): N = int(input()) A = [int(input()) for _ in range(N)] A.sort() if N == 1: print(1) return A_array = np.array(A[:-1]) A_array_slide = np.array(A[1:]) diff = A_array_slide - A_array if 1 in diff: print(2) else: print(1) if __name__ == "__main__": main()