#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

#define F first
#define S second

const int MAXN = 1e5 + 10;
const int INF = 1e9;

int n, ans;
vector<int> adj[MAXN];
bool del[MAXN];

bool dfs(int v, int p = -1){
	int cc = 0, ch = 0;
	for (int u:adj[v])
		if (u^p) {
			cc += dfs(u, v);
			ch++;
		}

	ans += max(0, ch-cc-1);
	if (cc || ch > 1)
		return true;
	return false;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	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);
	}
	int mx = -1, root = -1;
	for (int v = 0; v < n; v++)
		if ((int)adj[v].size() > mx) {
			root = v;
			mx = adj[v].size();
		}

	dfs(root);
	cout << max(1, ans) << "\n";
	return 0;
}
