bufio_scanner = [] def main(): n = int(fmt_scan()) a = [int(fmt_scan()) for _ in range(n)] a.sort() ans = n k = 0 for i in range(n): if i == 0: continue if a[i - 1 - k] + 1 < a[i]: ans -= 1 k = 0 else: k = 1 print(ans) def fmt_scan() -> str: sc = bufio_scanner if len(sc) == 0: for v in input().split()[::-1]: sc.append(v) res = sc[-1] sc.pop() return res main()