#include <bits/stdc++.h>
using namespace std;
double px[1005], py[1005];
double tx, ty;
int sum;
int pnpoly(int nvert, double *vertx, double *verty, double testx,
           double testy) {
  int i, j, c = 0;
  for (i = 0, j = nvert - 1; i < nvert; j = i++) {
    if (((verty[i] > testy) != (verty[j] > testy)) &&
        (testx <
         (vertx[j] - vertx[i]) * (testy - verty[i]) / (verty[j] - verty[i]) +
             vertx[i]))
      c = !c;
  }
  return c;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  while (cin >> n) {
    sum = 0;
    memset(px, 0, sizeof(px));
    memset(py, 0, sizeof(py));
    for (int i = 0; i <= n; i++) {
      cin >> px[i] >> py[i];
    }
    for (int i = 1; i < n; i++) {
      if (px[i] - px[i - 1] == 0) {
        tx = px[i];
        ty = abs(py[i] - py[i - 1]) / (py[i] - py[i - 1]) * 0.1 + py[i];
      } else if (py[i] - py[i - 1] == 0) {
        ty = py[i];
        tx = abs(px[i] - px[i - 1]) / (px[i] - px[i - 1]) * 0.1 + px[i];
      }
      if (pnpoly(n, px, py, tx, ty)) {
        sum++;
      }
    }
    cout << sum << endl;
  }
  return 0;
}
