#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int N = 1e5 + 5;
struct point {
  long long x, y;
  point() {}
  point(long long _x, long long _y) { x = _x, y = _y; }
};
long long cross(point p, point q, point r) {
  return (p.x - q.x) * (r.y - q.y) - (p.y - q.y) * (r.x - q.x);
}
int main() {
  int n;
  scanf("%d", &n);
  vector<point> p;
  for (int i = 1; i <= n + 1; i++) {
    long long a, b;
    scanf("%lld %lld", &a, &b);
    p.push_back(point(a, b));
  }
  int ans = 0;
  for (int i = 0; i < n + 1; i++) {
    if (i + 2 < (n + 1) && cross(p[i], p[i + 1], p[i + 2]) <= 0) {
      ans += 1;
    }
  }
  printf("%d\n", ans);
  return 0;
}
