#include <bits/stdc++.h>
#include <vector>

const int maxn = 1e5 + 10;

using namespace std;

int n, root = -1;
vector<int> v[maxn];

int dfs(int son, int fa)
{
    int ans = 0, flag = 0;
    for(int i = 0; i < v[son].size(); i++)
    {
        if(v[son][i]==fa)
            continue;
        int res = dfs(v[son][i], son);//判断是否为一条链
        if(res==0 && flag==1)
        {
            ans++;
        }
        if(res==0 && flag==0)
        {
            flag = 1;
        }
        ans += res;
    }
    return ans;
}

int main()
{
    scanf("%d", &n);
    for(int i = 0; i < n-1; i++)
    {
        int a, b;
        scanf("%d%d", &a, &b);
        v[a].push_back(b);
        v[b].push_back(a);
    }
    for(int i = 0; i < n; i++)
    {
        if(v[i].size() > 2)
        {
            root = i;
            break;
        }
    }
    if(root==-1)
    {
        puts("1");
    }
    else
    {
        printf("%d\n", dfs(root, -1));
    }
    return 0;
}
