#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int maxn = 1005;
struct Point {
  double x, y;
  void read() { scanf("%lf%lf", &x, &y); }
} p[maxn * 2];
int dcmp(double x) {
  if (fabs(x) < eps) return 0;
  return x > 0.0 ? 1 : -1;
}
double fork_mul(Point p1, Point p2, Point p0) {
  return (p1.x - p0.x) * (p2.y - p0.y) - (p2.x - p0.x) * (p1.y - p0.y);
}
int Count(int n) {
  int flag = 0, pre = dcmp(fork_mul(p[0], p[1], p[n - 1]));
  int ans = 0;
  for (int i = 1; i < n - 1; i++) {
    int tmp = dcmp(fork_mul(p[i], p[i + 1], p[i - 1]));
    if (tmp == pre) {
      if (flag) ans++;
    } else {
      flag ^= 1;
      if (flag) ans++;
    }
    pre = tmp;
  }
  return ans;
}
int main() {
  int n, id = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    p[i].read();
    if (i > 0)
      if (p[i].y < p[id].y || p[i].y == p[id].y && p[i].x < p[id].x) {
        id = i;
      }
  }
  p[n].read();
  for (int i = 0; i < id; i++) p[i + n] = p[i];
  for (int i = id; i < n + id; i++) p[i - id] = p[i];
  printf("%d\n", Count(n));
  return 0;
}
