#include<iostream>
#include<cstdio>
#define MN 100000 
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int head[MN+5],cnt=0,f[MN+5],d[MN+5],n,rt,ans,g[MN+5];
struct edge{int to,next;}e[MN*2+5];
inline void ins(int f,int t)
{
	e[++cnt]=(edge){t,head[f]};head[f]=cnt;++d[f];
	e[++cnt]=(edge){f,head[t]};head[t]=cnt;++d[t];
}
void dfs(int x,int fa)
{
	int num=0,gg=0,num2=0;
	for(int i=head[x];i;i=e[i].next)
		if(e[i].to!=fa) 
		{
			dfs(e[i].to,x);
			if(f[e[i].to]) f[x]=1,++num2,gg|=g[e[i].to];
			else ++num;	
		}
	if(num>1) ans+=num-1,num2+=num-1,num=1,f[x]=1;
	g[x]=(num2<2&&gg)|(fa&&num);
//	cout<<x-1<<" "<<num<<" "<<num2<<" "<<gg<<" "<<f[x]<<" "<<g[x]<<endl;
}
int main()
{
	n=read();if(n==2)return 0*puts("1");
	for(int i=1;i<n;++i) ins(read()+1,read()+1);
	for(rt=1;d[rt]<2;++rt);dfs(rt,0);
	cout<<ans+g[rt];
	return 0;
}

