#include<bits/stdc++.h>
using namespace std;
const int maxN = 1e5 + 13;
int n, deg[maxN], ans;
bool path[maxN];
vector<int> adj[maxN];
void dfs (int x, int p) {
    if (deg[x] == 1)
	path[x] = 1;
    
    for (auto a : adj[x]) {
	if (a != p) {
	    dfs(a, x);
	    if (path[a] && deg[x] == 2)
		path[x] = 1;
	}
    }
}

void solve (int x, int p) {
    bool fl = 0;
    if (deg[x] == 1)
	ans++;
    for (auto a : adj[x]) {
	if (a != p) {
	    if (path[a] && !fl && !path[x])
		fl = 1;
	    else
		solve(a, x);
	}
    }
}

int main () {
    cin >> n;
    for (int i = 0; i < n - 1; i++) {
	int a, b;
	cin >> a >> b;
	adj[a].push_back(b);
	adj[b].push_back(a);
	deg[a]++;
	deg[b]++;
    }
    int st = n + 13;
    for (int i = 0; i < n; i++) {
	if (deg[i] > 2) {
	    st = i;
	    dfs(i, i);
	    break;
	}
    }
    if (st == n + 13)
	return cout << 1 << endl, 0;
    solve(st, st);
    cout << ans << endl;
}
