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