#include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const int MAX_N = 200000; vector E[MAX_N]; void dfs(int u, int p, vector &used) { bool has_child = false; for (int v : E[u]) { if (v == p) continue; dfs(v, u, used); if (used[v]) has_child = true; } if (not has_child) used[u] = true; } int main() { int N; cin >> N; int u, v; for (int i = 0; i < N - 1; ++i) { cin >> u >> v; E[u].push_back(v); E[v].push_back(u); } vector used(N + 1, false); dfs(1, -1, used); int ans = 0; for (int u = 1; u <= N; ++u) { if (used[u]) ++ans; } cout << ans << endl; return 0; }