include
include
include
include
include
include
define db double
using namespace std;
const int N=1e5+10,M=2*N;
int next[M],head[N],go[M],tot;
inline void add(int u,int v){
next[++tot]=head[u];head[u]=tot;go[tot]=v;
next[++tot]=head[v];head[v]=tot;go[tot]=u;
}
struct node{
int dep,id,f;
bool operator<(const node &x)const{
return dep<x.dep;
}
}a[M];
bool vis[N];
int n;
void dfs(int x,int fa,int dep){
a[x]=(node){dep,x,fa};
for(int i=head[x];i;i=next[i]){
int v=go[i];
if(v==fa)continue;
dfs(v,x,dep+1);
}
}
priority_queue
int main(){
cin>>n;
for(int i=1,u,v;i<n;i++){
scanf("%d%d",&u,&v);
add(u,v);
}
dfs(1,1,1);
for(int i=1;i<=n;i++)q.push(a[i]);
int ans=0;
while(q.size()){
node t=q.top();q.pop();
if(vis[t.id])continue;
vis[t.id]=1;
vis[t.f]=1;
ans++;
for(int i=head[t.f];i;i=next[i]){
int v=go[i];
vis[v]=1;
}
}
cout<<ans<<endl;
}