N = int(input()) a = [] for _ in range(N): a.append(int(input())) a.sort() cnt = [a[i+1] - a[i] <= 1 for i in range(N-1)].count(True) + 1 print(cnt)