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 == 1) root = i;
    int ans = 0;

    void dfs(int n, int p) {
        if (p != -1) {
            ans += max(0, G[n].length.to!int - 2);
        }
        foreach (m; G[n]) {
            if (m == p) continue;
            dfs(m, n);
        }
    }

    dfs(0, -1);
    writeln(ans + 1);
}