#include <bits/stdc++.h> 
using namespace std;

int main()
{
    long long n;
    long long b;
    long long c;
    long long nn;
    long long r=0;
    long long sg;
    long long p;
    long long t1;
    long long t2;

    long long granice[100000];

    cin >> n;

    b = n/2 + n%2;
    c = n/2;
    sg = b-1;

    fill (granice, granice + n-1, 0);

    for (long long i = 0; i<n-1; i++)
    {
        cin >> t1 >> t2;
        granice[t1]++;
        granice[t2]++;

        if(granice[t1] > 2)
        {
            r++;
        }

        if(granice[t2] > 2)
        {
            r++;
        }
    }

    p = sg + c-2 + n%2 - r/2;
    cout << p;

	return 0;
}