#include #include #include using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin>>n; vector> g(n); for(int i = 0;i>u>>v; u--;v--; g[u].push_back(v); g[v].push_back(u); } vector dp1(n,0),dp2(n,0); auto calc = [&](auto calc,int ni,int p) -> void { for(auto&to:g[ni]) if(to!=p) { calc(calc,to,ni); dp1[ni] += dp2[to]; dp2[ni] += min(dp1[to],dp2[to]); } dp2[ni]++; }; calc(calc,0,-1); int ans = min(dp1[0],dp2[0]); cout<