#include <bits/stdc++.h>
using namespace std;
int main () {
    ios_base::sync_with_stdio(false);
    int n ;
    cin >> n ;
    int a ;
    for (int i = 0 ; i < n ; i++ ) {
        cin >> a ;
        cin >> a ;
    }
    cout << n-2 - (n+1)%2;
}