#include > #define pt(sth) cout << sth << "\n" using namespace std; //#include //using namespace atcoder; typedef long long ll; typedef pair pll; templatebool chmax(T &a, const T &b) {if(abool chmin(T &a, const T &b) {if(b>a[i]; typedef vector>> v3D; typedef vector> v2D; typedef vector v1D; vector g[MAX]; vector nc; vector pa; ll dfs(ll u,ll p){ pa[u]=p; if(u>0 and g[u].size()==1) return nc[u]=1; ll res=1; for(auto v:g[u]){ if(v==p) continue; res+=dfs(v, u); } return nc[u]=res; } int main() { ll i, j, k; ll N;cin>>N; nc=vector(N,0); pa=vector(N,0); for(i=0;i>a>>b;a--;b--; g[a].push_back(b); g[b].push_back(a); } dfs(0,N); ll ans=0; for(ll u=0;u