package main import . "fmt" import . "os" import bf "bufio" func main() { rd:=bf.NewReader(Stdin) var n,m int Fscan(rd,&n,&m) c:=make([]int,2*n+1) g:=make([][]int,2*n+1) for ;m>0;m-- { var a,b int Fscan(rd,&a,&b) g[a]=append(g[a],b) g[b]=append(g[b],a) } v:=make([]bool,2*n+1) p:=0 for i,t:=range g{ if v[i] { continue } v[i]=true p++ c[p]++ es:=t[:] for len(es)>0 { e:=es[len(es)-1] es=es[:len(es)-1] if v[e] { continue } v[e]=true c[p]++ es=append(es,g[e]...) } } var ans int for _,v:=range c[2:] { ans+=v%2 } ans/=2 Println(ans) }