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

vector<int> edge[100005];
int dp[100005], X[100005];

void dfs(int x, int p){
	int t = 0;
	for(auto i: edge[x]){
		if(i == p) continue;
		dfs(i, x);
		dp[x] += dp[i];
		if(!dp[i]) ++t;
	}
	if(t) dp[x] += t-1;
	if(t || edge[x].size() == 1) X[x] = 1;
}

bool dfs(int x, int p, int c){
	if(X[x] && !c) return 1;
	for(auto i: edge[x]){
		if(p==i) continue;
		if(dfs(i, x, dp[x]>dp[i] || c)) return 1;
	}
	return 0;
}

int main(){ 
	ios_base::sync_with_stdio(0), cin.tie(0);
	int N; cin>>N;
	for(int i=1; i<N; ++i){
		int x,y; cin>>x>>y;
		edge[x].push_back(y), edge[y].push_back(x);
	}
	dfs(0, -1);
	X[0] = 0;

	cout<<dp[0]+dfs(0, -1, 0);
	return 0;
}