#include <stdio.h>
#include <stdlib.h>

main(void)
{
    int n, i, cnt = 0, *degrees;
    freopen("space.in", "r", stdin);
    freopen("space.out", "w", stdout);
    scanf("%d", &n);
    degrees = (int*) (malloc(n * sizeof(int)));
    memset(degrees, 0, n * sizeof(int));
    for (i = 1; i < n; i++)
    {
        int s, e;
        scanf("%d%d", &s, &e);
        degrees[s - 1]++;
        degrees[e - 1]++;
    }
    for (i = 0; i < n; i++)
    {
        if (degrees[i] > 1)
        {
            cnt++;
        }
    }
    printf("%d\n", cnt);
    free(degrees);
}
