N = int(input()) Alist = [] for _ in range(N): a = int(input()) Alist.append(a) Alist.sort() a = Alist[0] cnt = 1 for i in range(1, N): if Alist[i] == a+1: cnt += 1 a = Alist[i] print(cnt)