#include <bits/stdc++.h>
#define name "BC"
#define FOR(i, a, b) for (ll i = (a); i <= (b); ++i)
#define FOD(i, a, b) for (ll i = (a); i >= (b); --i)
#define FOO(i, n) for (int i = 0; i < (n); ++i)
#define MEM(a, val) memset(a, val, sizeof(a))
#define all(x) (x).begin(), (x).end()
#define el '\n'
#define f first
#define se second
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;

template<class t> bool cmi(t &a, const t &b) { return b < a && (a = b, 1); }
template<class t> bool cma(t &a, const t &b) { return b > a && (a = b, 1); }
const int inf = 1e9+7;
const int nx = 2e5+3;
int n;
vector<int> ad[nx];
int dp[nx];
int run[nx];
int tg[nx];
void dfs(int z,int par) {
    int best = 0;
    int tot = 0;
    run[z] = inf;
    tg[z] = tg[par]+1;
    int child = 0;
    for (auto x:ad[z]) {
        if (x == par) continue;
        ++child;
        dfs(x,z);
        if (run[x]+1 < run[z]) {
            run[z] = run[x]+1;
            best = dp[x];
        }
        tot += dp[x];
    }
    if (tg[z] < run[z]) dp[z] = tot;
    else dp[z] = best;
    if (!child) run[z] = 0,dp[z] = 1;
}
int main() {
    if (fopen(name".inp", "r")) { freopen(name".inp", "r", stdin); freopen(name".out", "w", stdout); }
    else if (fopen(".inp", "r")) { freopen(".inp", "r", stdin); freopen(".out", "w", stdout); }
            ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    FOR(i,1,n-1) {
        int x,y; cin >> x >> y;
        ad[x].pb(y);
        ad[y].pb(x);
    }
    tg[0] = -1;
    dfs(1,0);
    cout << dp[1];
    // FOR(i,1,n) cout << i << ' ' << dp[i] << '\n';
    return 0;
}