n = int(input()) a = [int(input()) for i in range(n)] a.sort() ans = 1 for i in range(1, n): if a[i - 1] + 1 >= a[i]: ans += 1 print(ans)