n=input() x=sorted(list(map(int,input().split(" ")))) while True: try: f=False for i in range(len(x)): x1,x2=x[i],x[i+1] if (x1+x2)%2==0 or (x1-1 in x and x2+1 in x): continue x.remove(x1) x.remove(x2) f=True if f==False: break except IndexError: if len(x)==1: break continue print(len(x))