n=int(input()) ns=[int(input()) for i in range(n)] ns.sort(reverse=True) lis=[0]*n cnt=0 def cal(x): lis[x]=1 now = ns[x] for i in range(n): if lis[i] == 1: continue if now > ns[i]+1: now = ns[i] lis[i] = 1 for i in range(n): if lis[i] == 0: cal(i) cnt+=1 print(cnt)