n = int(input()) A = [int(input()) for _ in range(n)] A.sort() ans = 1 for i in range(n-1): if A[i+1] - A[i] == 1: ans += 1 break print(ans)