#include using namespace std; using ll = long long; int n; vector< vector > G; int dfs(int cur, int par, int& cnt) { int res = 0; for (int nex : G[cur]) { if (nex == par) continue; if (dfs(nex, cur, cnt) == 0) { res = 1; } } cnt += (res == 0); return res; } int main() { cin.tie(0); ios::sync_with_stdio(false); cin >> n; G.resize(n); for (int i = 1; i < n; i++) { int u, v; cin >> u >> v; u--; v--; G[u].push_back(v); G[v].push_back(u); } int ans = 0; dfs(0, -1, ans); cout << ans << endl; return 0; }