#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int i, ans = 0;
    int a[1050], b[1050];
    for (i = 0; i <= n; i++) cin >> a[i] >> b[i];
    for (i = 2; i <= n; i++)
      if (((a[i - 1] - a[i - 2]) * (b[i] - b[i - 2]) -
           (a[i] - a[i - 2]) * (b[i - 1] - b[i - 2])) > 0)
        ans++;
    cout << ans << endl;
  }
  return 0;
}
