#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;

int main() {
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    int u[n];
    int v[n];

    for (int i = 0; i < n; i++) {
        cin >> u[i] >> v[i];
    }

    float x = n - 2 - (n % 2 == 0 ? 1 : 0);
    cout << x;

    return 0;
}