/// author:Kissheart ///
#include<stdio.h>
#include<algorithm>
#include<iostream>
#include<string.h>
#include<vector>
#include<stdlib.h>
#include<math.h>
#include<queue>
#include<deque>
#include<ctype.h>
#include<map>
#include<set>
#include<stack>
#include<string>
#define INF 0x3f3f3f3f
#define FAST_IO ios::sync_with_stdio(false)
const double PI = acos(-1.0);
const double eps = 1e-6;
const int MAX=1e5+10;
const int mod=1e9+7;
typedef long long ll;
using namespace std;
#define gcd(a,b) __gcd(a,b)
inline ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
inline ll qpow(ll a,ll b){ll r=1,t=a; while(b){if(b&1)r=(r*t)%mod;b>>=1;t=(t*t)%mod;}return r;}
inline ll inv1(ll b){return qpow(b,mod-2);}
inline ll exgcd(ll a,ll b,ll &x,ll &y){if(!b){x=1;y=0;return a;}ll r=exgcd(b,a%b,y,x);y-=(a/b)*x;return r;}
inline ll read(){ll x=0,f=1;char c=getchar();for(;!isdigit(c);c=getchar()) if(c==‘-‘) f=-1;for(;isdigit(c);c=getchar()) x=x*10+c-‘0‘;return x*f;}
//freopen( "in.txt" , "r" , stdin );
//freopen( "data.txt" , "w" , stdout );
int head[MAX*2],cur,a[MAX];
int vis[MAX],n,pre[MAX],num;
struct node
{
int u,next;
}e[MAX*2];
void add(int u,int v)
{
e[++cur].u=v;
e[cur].next=head[u];
head[u]=cur;
}
void dfs(int u)
{
a[++num]=u;
for(int i=head[u];i;i=e[i].next)
{
if(vis[e[i].u]) continue;
vis[e[i].u]=1;
pre[e[i].u]=u;
dfs(e[i].u);
}
}
int s[MAX];
int MDS()
{
int ans=0,p;
memset(vis,0,sizeof(vis));
for(int i=num;i>=1;i--)
{
p=a[i];
if(!vis[p])
{
if(!s[pre[p]])
{
s[pre[p]]=1;
ans++;
}
vis[p]=1;
vis[pre[p]]=1;
vis[pre[pre[p]]]=1;
}
}
return ans;
}
int main()
{
scanf("%d",&n);
for(int i=1;i<=n-1;i++)
{
int x,y;
scanf("%d%d",&x,&y);
add(x,y);
add(y,x);
}
vis[1]=1;
pre[1]=1;
dfs(1);
/* for(int i=1;i<=num;i++)
printf("%d ",a[i]);*/
printf("%d\n",MDS());
return 0;
}