#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int xcoor[n];
  int ycoor[n];
  for (int i = 0; i <= n; i++) {
    scanf("%d", &xcoor[i]);
    scanf("%d", &ycoor[i]);
  }
  int dir[n];
  int danger = 0;
  for (int i = 0; i < n; i++) {
    if (xcoor[i] < xcoor[i + 1]) {
      dir[i] = 2;
    } else if (xcoor[i] > xcoor[i + 1]) {
      dir[i] = 4;
    } else if (ycoor[i] > ycoor[i + 1]) {
      dir[i] = 3;
    } else if (ycoor[i] < ycoor[i + 1]) {
      dir[i] = 1;
    }
  }
  for (int i = 0; i < n; i++) {
    if (dir[i - 1] == 1 and xcoor[i] > xcoor[i + 1]) {
      danger++;
    } else if (dir[i - 1] == 2 and ycoor[i] < ycoor[i + 1]) {
      danger++;
    } else if (dir[i - 1] == 3 and xcoor[i] < xcoor[i + 1]) {
      danger++;
    } else if (dir[i - 1] == 4 and ycoor[i] > ycoor[i + 1]) {
      danger++;
    }
  }
  printf("%d\n", danger);
}
