#include using namespace std; using ll= long long; int main(){ ll n; cin >> n; vector>g(n); for (ll i = 0; i < n-1; i++) { ll u,v; cin >> u >> v; u--,v--; g[u].push_back(v); g[v].push_back(u); } vectormemo(n,99999999); memo[0]=0; queueque; que.push(0); while (!que.empty()) { ll v=que.front(); que.pop(); for (ll i = 0; i < g[v].size(); i++) { if (memo[g[v][i]]>memo[v]+1) { memo[g[v][i]]=memo[v]+1; que.push(g[v][i]); } } } vectorst(n,0); vector>p(n); for (ll i = 0; i < n; i++) { p[i]={memo[i],i}; } sort(p.begin(),p.end()); reverse(p.begin(),p.end()); ll ans=0; for (ll i = 0; i < n; i++) { ll x=p[i].second; bool ok=true; for (ll j = 0; j < g[x].size(); j++) { if (st[g[x][j]]) { ok=false; break; } } if (ok) { st[x]=1; ans++; } } cout << ans << endl; }