#include <bits/stdc++.h>

using namespace std;

int main(){
    long long n;
    cin >> n;
    long long niz1[n], niz2[n];
    for(long long i = 0 ; i < n - 1 ; i++){
        cin >> niz1[i] >> niz2[i];
    }
    if(n == 0 || n == 1 || n == 2) cout << 0;
    else{
    if(n % 2 == 1) n = n / 2 + 1;
    else n = n / 2;
    if(n < 2) cout << 1;
    else cout << n - 1;
    }
    return 0;
}