#include <bits/stdc++.h>
using namespace std;
int x[1010], y[1010];
int n, d, L;
int solve(int p) {
  int l = p - 1, r = p + 1;
  if (x[l] == x[p]) {
    if (y[p] > y[l] && x[r] > x[p]) return 1;
    if (y[p] < y[l] && x[r] < x[p]) return 1;
  } else {
    if (x[p] < x[l] && y[r] > y[p]) return 1;
    if (x[p] > x[l] && y[r] < y[p]) return 1;
  }
  return 0;
}
int main() {
  while (scanf("%d", &(n)) == 1) {
    for (int i = (1); i <= (n + 1); i++) scanf("%d%d", &(x[i]), &(y[i]));
    if (x[n] > x[1])
      L = 1;
    else
      L = 0;
    int ans = 0;
    for (int i = (2); i <= (n); i++) {
      d = solve(i);
      if (d == L) continue;
      ans++;
    }
    printf("%d\n", ans);
  }
  return 0;
}
