#include <bits/stdc++.h>
using namespace std;
struct Tp {
  int x, y;
  void init() { scanf("%d%d", &x, &y); }
} P[(1000 + 100)];
Tp operator-(Tp A, Tp B) {
  Tp tmp;
  tmp.x = A.x - B.x;
  tmp.y = A.y - B.y;
  return tmp;
}
bool check(int i) {
  Tp A = P[i] - P[i - 1], B = P[i - 1] - P[i - 2];
  int tmp = A.x * B.y - A.y * B.x;
  return tmp < 0;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i <= n; i++) P[i].init();
  int ans = 0;
  for (int i = 2; i <= n; i++)
    if (check(i)) ans++;
  return printf("%d\n", ans), 0;
}
