#include #include #include #include #include #include #include #include #include #include #include #include #define vll vector #define vvvl vector #define vvl vector> #define VV(a, b, c, d) vector>(a, vector(b, c)) #define VVV(a, b, c, d) vector(a, vvl(b, vll (c, d))); #define re(c, b) for(ll c=0;c> n; re(i, n-1){ ll a, b;std::cin >> a >> b; G[a].push_back(b); G[b].push_back(a); } ll cnt = 0; for(int i=1;i<=n;i++) if(G[i].size()==1) cnt++; std::cout << cnt - 2 << '\n'; return 0; }