import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio;

void main() {
    auto N = readln.chomp.to!int;
    auto G = new int[][](N);
    foreach (i; 0..N-1) {
        auto s = readln.split.map!(to!int);
        G[s[0]] ~= s[1];
        G[s[1]] ~= s[0];
    }

    int root = -1;
    foreach (i; 0..N) if (G[i].length >= 3) root = i;
    if (root == -1) {
        writeln(1);
        return;
    }

    int dfs(int n, int p) {
        int ret = 0;
        int cnt = 0;
        int children = G[n].length.to!int - (p != -1);
        foreach (m; G[n]) {
            if (m == p) continue;
            int v = dfs(m, n);
            ret += v;
            cnt += v > 0;
        }
        if (cnt < children - 1) ret += children - 1 - cnt;
        return ret;
    }

    dfs(root, -1).writeln;
}