#include <bits/stdc++.h>
using namespace std;
int n;
int xi0;
int yi0;
int xi1;
int yi1;
int xi2;
int yi2;
int countX;
int main(int argc, char** argv) {
  cin >> n;
  cin >> xi0 >> yi0 >> xi1 >> yi1;
  countX = 0;
  for (int i = 2; i <= n; i++) {
    cin >> xi2 >> yi2;
    if ((xi0 < xi1 && yi1 < yi2) || (xi0 > xi1 && yi1 > yi2) ||
        (yi0 > yi1 && xi1 < xi2) || (yi0 < yi1 && xi1 > xi2))
      countX++;
    xi0 = xi1;
    yi0 = yi1;
    xi1 = xi2;
    yi1 = yi2;
  }
  cout << countX;
}
