#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

vector<vector<int>> g;
vector<int> dp;
void dfs(int u, int p) {
    int sum = 0, zero = 0;
    for (int v: g[u]) if (v != p) {
        dfs(v, u);
        sum += dp[v];
        zero += dp[v] == 0;
    }
    sum += max(0, zero - 1);
    dp[u] = sum;
}

int main() {
    int n; cin >> n;
    g.resize(n);
    for (int i = 0; i < n - 1; i++) {
        int a, b; cin >> a >> b;
        g[a].emplace_back(b);
        g[b].emplace_back(a);
    }
    int r = -1;
    for (int i = 0; i < n; i++) if (g[i].size() > 2) r = i;
    if (r == -1) return !(cout << 1 << endl);
    dp.resize(n);
    dfs(r, -1);
    cout << dp[r] << endl;
    return 0;
}
