#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long int san[10005] = {0}, raj[10005] = {0}, count = 0;
  long long int atul, rahul, panjo, ankit;
  cin >> san[1] >> raj[1] >> san[2] >> raj[2];
  for (int i = 3; i <= n + 1; i++) {
    cin >> san[i] >> raj[i];
    rahul = (san[i - 1] - san[i - 2]) * (raj[i - 1] + raj[i - 2]);
    panjo = (san[i] - san[i - 1]) * (raj[i] + raj[i - 1]);
    ankit = (san[i - 2] - san[i]) * (raj[i - 2] + raj[i]);
    atul = rahul + panjo + ankit;
    if (atul < 0) count++;
  }
  cout << count << endl;
  return 0;
}
