#include <iostream>

using namespace std;

int main()
{
    ios_base :: sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    long n;
    cin >> n;
    for (long i=0;i<n-1;i++)
    {
        long x,y;
        cin >> x >> y;
    }
    if (n%2==0) cout << n-3; else cout << n-2;
    return 0;
}