#include <bits/stdc++.h>
using namespace std;
struct point {
  int x;
  int y;
};
point ps[1010];
int cross_product(point p0, point p1, point p2) {
  return (p1.x - p0.x) * (p2.y - p0.y) - (p1.y - p0.y) * (p2.x - p0.x);
}
int dir(point p1, point p2, point p3) {
  int temp = cross_product(p1, p2, p3);
  if (temp > 0)
    return 1;
  else if (temp < 0)
    return -1;
  else if (temp = 0)
    return 0;
}
int n;
int main() {
  ios::sync_with_stdio(false);
  while (cin >> n) {
    for (int i = 1; i <= n + 1; i++) {
      cin >> ps[i].x >> ps[i].y;
    }
    int init_dir = dir(ps[n], ps[1], ps[2]);
    int ans = 0;
    int temp;
    for (int i = 1; i <= n - 1; i++) {
      temp = dir(ps[i], ps[i + 1], ps[i + 2]);
      if (temp != init_dir) ans++;
    }
    cout << ans << endl;
  }
}
