#include <bits/stdc++.h>
using namespace std;
int n;
struct point {
  int x, y;
} p[1010];
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n + 1; i++) {
      scanf("%d", &p[i].x);
      scanf("%d", &p[i].y);
    }
    int num = 0;
    for (int i = 1; i <= n - 1; i++) {
      int px1 = p[i].x, px2 = p[i + 1].x, px3 = p[i + 2].x;
      int py1 = p[i].y, py2 = p[i + 1].y, py3 = p[i + 2].y;
      int vx1 = px2 - px1, vx2 = px3 - px2;
      int vy1 = py2 - py1, vy2 = py3 - py2;
      if (vx1 * vy2 - vy1 * vx2 > 0) {
        num++;
      }
    }
    printf("%d", num);
    printf("\n");
    ;
  }
}
