#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mk make_pair
#define rint register int
using namespace std;
inline int read(){int w=1,s=0;char ch=getchar();while(!isdigit(ch)){if(ch=='-')w=-1;ch=getchar();}while(isdigit(ch)){s=s*10+ch-'0';ch=getchar();}return w*s;}
struct node{
	int to,next;
}e[1000010];
int dp[1000010],h[1000010],tot,du[1000010];
inline void add(int from,int to){e[++tot].next=h[from];h[from]=tot;e[tot].to=to;}
int n;
inline void DFS(int now,int ffa)
{
	int fl=0;
	for(rint i=h[now];i;i=e[i].next)
	{
		int to=e[i].to;
		if(to==ffa) continue;
		DFS(to,now);
		dp[now]+=dp[to];
		if(!dp[to])
		{	if(!fl)
			fl=1;
			else 
			dp[now]++;
		}
	}
}
int main()
{
	n=read();int rt=0;
	for(rint i=1;i<n;++i)
	{
		int u=read()+1,v=read()+1;add(u,v);add(v,u);du[v]++;du[u]++;
	}
	for(rint i=1;i<=n;++i) if(du[i]>2) rt=i;
	if(!rt) 
	{
		cout<<1;return 0;
	}
	DFS(rt,0); 
	cout<<dp[rt]<<"\n";
	return 0;
}


