ll n,r,u[2d5],w[2d5]; vector v[2d5]; deque q; { rd(n,u(n*2-2)); rep(i,n*2-2)v[u[i]].push_back(u[i^1]); rep(j,1,n+1)if(v[j].size()<2){ q.push_back(j); w[j]=1; } while(!q.empty()){ ll j=q.front(); q.pop_front(); r+=w[j]&1; while(!v[j].empty()){ ll x=v[j].back(); v[j].pop_back(); if(!w[x]){ w[x]=w[j]+1; q.push_back(x); } } } wt(r); }