#include <iostream>
using namespace std;

int main()
{
    long n,a,b;
    cin >> n;
    for(int i=0;i<n-1;i++)
    {
        cin >> a;
        cin >> b;
    }
    if(n%2==0)
    {
        cout << (n/2-1);
    }
    if(n%2!=0)
    {
        cout << (n/2);
    }
}