#include <bits/stdc++.h>
using namespace std;
int n, danger;
int curve[1002][1002];
int main(void) {
  cin >> n;
  for (int i = 0; i <= n; i++) {
    int a, b;
    cin >> a >> b;
    curve[i][0] = a;
    curve[i][1] = b;
  }
  curve[n + 1][0] = curve[1][0];
  curve[n + 1][1] = curve[1][1];
  for (int i = 0; i < n - 2; i++) {
    if (curve[i][0] < curve[i + 1][0] && curve[i + 1][1] < curve[i + 2][1] &&
        curve[i + 2][0] > curve[i + 3][0])
      danger++;
    if (curve[i][1] < curve[i + 1][1] && curve[i + 1][0] > curve[i + 2][0] &&
        curve[i + 2][1] > curve[i + 3][1])
      danger++;
    if (curve[i][1] > curve[i + 1][1] && curve[i + 1][0] < curve[i + 2][0] &&
        curve[i + 2][1] < curve[i + 3][1])
      danger++;
    if (curve[i][0] > curve[i + 1][0] && curve[i + 1][1] > curve[i + 2][1] &&
        curve[i + 2][0] < curve[i + 3][0])
      danger++;
    if (curve[i][0] > curve[i + 1][0] && curve[i + 1][1] > curve[i + 2][1] &&
        curve[i + 2][0] > curve[i + 3][0])
      danger++;
    if (curve[i][1] < curve[i + 1][1] && curve[i + 1][0] > curve[i + 2][0] &&
        curve[i + 2][1] < curve[i + 3][1])
      danger++;
    if (curve[i][1] > curve[i + 1][1] && curve[i + 1][0] < curve[i + 2][0] &&
        curve[i + 2][1] > curve[i + 3][1])
      danger++;
    if (curve[i][0] < curve[i + 1][0] && curve[i + 1][1] < curve[i + 2][1] &&
        curve[i + 2][0] < curve[i + 3][0])
      danger++;
  }
  cout << danger;
}
