n,m = map(int,input().split()) graph=[[] for _ in range(n)] for i in range(m): a,b = map(int,input().split()) graph[a-1].append(b-1) c1=0 c2=0 for i in range(n): if len(graph[i])%2==1: c1+=1 else: c2+=1 print(abs(c1-2))