#include <cstdio>
#include <vector>

const int N = 100000;

int n;
std::vector<int> tree[N];

int dfs(int p, int u)
{
    int result = 0, zeros = 0;
    for (int v : tree[u]) {
        if (v == p) {
            continue;
        }
        int r = dfs(u, v);
        result += r;
        zeros += !r;
    }
    return result + std::max(zeros - 1, 0);
}

int main()
{
    scanf("%d", &n);
    for (int i = 0, a, b; i < n - 1; ++ i) {
        scanf("%d%d", &a, &b);
        tree[a].push_back(b);
        tree[b].push_back(a);
    }
    int r = 0;
    while (r < n && tree[r].size() < 3) {
        r ++;
    }
    if (r == n) {
        puts("1");
    } else {
        printf("%d\n", dfs(-1, r));
    }
}
