#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, sum;
  int xx[10005], yy[10005], a[10005];
  while (scanf("%d", &n) != EOF) {
    sum = 0;
    for (i = 0; i <= n; i++) {
      scanf("%d %d", &xx[i], &yy[i]);
    }
    for (i = 0; i < n; i++) {
      if (xx[i] == xx[i + 1] && yy[i + 1] > yy[i]) a[i] = 1;
      if (xx[i] < xx[i + 1] && yy[i + 1] == yy[i]) a[i] = 2;
      if (xx[i] == xx[i + 1] && yy[i + 1] < yy[i]) a[i] = 3;
      if (xx[i] > xx[i + 1] && yy[i + 1] == yy[i]) a[i] = 4;
    }
    for (i = 0; i < n - 1; i++) {
      if (a[i] > a[i + 1]) sum++;
    }
    printf("%d\n", sum);
  }
}
