#include <iostream>

using namespace std;

int n, rez;
int t1, t2;

int main()
{
    std::ios::sync_with_stdio(false);

    cin >> n;

    for(int i = 0;i < n - 1;i++){
        cin >> t1 >> t2;
    }

    rez = n;

    if(rez % 2 == 0){
        rez -= 3;
    }else
        rez -= 2;

    cout << rez;

    return 0;
}