#include <bits/stdc++.h>   using namespace std;   const int mod = 1e9 + 7;   const int maxn = 200005;   vector<int> g[maxn];   int dis[maxn];   int pa[maxn];   set<pair<int, int>> st;   void dfs(int now, int pre = 0) {     if (dis[now] > 2) {       st.insert({dis[now], now});     }     for (auto &i : g[now]) {       if (i ^ pre) {         pa[i] = now;         dis[i] = dis[now] + 1;         dfs(i, now);       }     }   }   void go() {     int n;     cin >> n;     for (int i = 0; i < n - 1; i++) {       int x, y;       cin >> x >> y;       g[x].push_back(y);       g[y].push_back(x);     }     dfs(1);     int ans = 0;     while (st.size()) {       auto x = *(--st.end());       int v = pa[x.second];       st.erase({dis[v], v});       for (auto &i : g[v]) {         st.erase({dis[i], i});       }       ans++;     }     cout << ans <<   n ;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     int c = 0;     int t;     if (!c) {       t = 1;     } else {       cin >> t;     }     while (t--) {       go();     }   }   