#include <bits/stdc++.h>

using namespace std;

int main()
{

    ios::sync_with_stdio(0);
    cin.tie(0);

    int n ;

    cin >> n;

    int a[2*n];


    int _n = n-1;

    int i = 0;

    while(_n--)
      {
        cin >> a[i] >> a[i+1];
        i+=2;
      }


    if(!(n%2))
        cout << n-3;
    else
        cout << n-2;




    return 0;
}