#include <iostream>

using namespace std;

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