#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    for(int i = 0; i < n - 1; i++){
        int a, b;
        cin >> a >> b;
    }
    if(n % 2 == 0)
        cout << n - 3 << endl;
    else
        cout << n - 2 << endl;
    return 0;
}