n = input() array = [int(input()) for i in range(int(n))] answer = 0 for i in array: if any([i + 1 < j for j in array]) is True: continue answer += 1 print(answer)