n = int(input()) a = sorted([int(input()) for _ in range(n)]) ans = n for i in range(n - 1): if a[i] + 1 < a[i + 1]: ans -= 1 print(ans)