N = int(input()) A = [] for _ in range(N): A.append(int(input())) A.sort(reverse=True) L = [] for a in A: for i in range(len(L)): if L[i] > a + 1: L[i] = a break else: L.append(a) print(len(L))