n = int(input()) A = [int(input()) for i in range(n)] A.sort() group = [] for a in A: flag = True for i, g in enumerate(group): if g + 1 < a: group[i] = a flag = False break if flag: group.append(a) print(len(group))