def main(): from sys import stdin readline=stdin.readline n = int(readline()) A = [int(readline()) for _ in range(n)] A.sort() cnt = 0 for i in range(n-1): if A[i+1] - A[i] <= 2: cnt += 1 print(cnt + 1) main()