#include <bits/stdc++.h>
using namespace std;

const int N = 100005;

int n, d[N][2];
vector<int> e[N];

int f(int x, int y, int z){
    if(d[x][y] >= 0) return d[x][y];
    if(y == 0 && e[x].size() > 2) return d[x][y] = N;
    if(e[x].size() == 1) return d[x][y] = y;
    int r = 0, m = 0;
    for(int i : e[x]){
        if(i == z) continue;
        if(y == 0) return d[x][y] = f(i, y, x);
        int a = f(i, 0, x);
        int b = f(i, 1, x);
        r += b;
        if(!a) m = max(m, b);
    }
    return d[x][y] = r - (e[x].size() > 2) * m;
}

int main(){
    scanf("%d", &n);
    for(int i = 0, x, y; i < n - 1; i++){
        scanf("%d%d", &x, &y);
        e[x].push_back(y);
        e[y].push_back(x);
    }
    for(int i = 0; i < n; i++) d[i][0] = d[i][1] = -1;
    for(int i = 0; i < n; i++) if(e[i].size() > 2){
        printf("%d\n", f(i, 1, -1));
        return 0;
    }
    puts("1");
}