#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, tot = 0;
  int x0, y0, x1, y1;
  cin >> n;
  int v0x, v0y, v1x, v1y;
  cin >> x0 >> y0;
  x1 = x0;
  y1 = y0;
  cin >> x0 >> y0;
  v0x = x0 - x1;
  v0y = y0 - y1;
  for (; n > 1; n--) {
    v1x = v0x;
    v1y = v0y;
    x1 = x0;
    y1 = y0;
    cin >> x0 >> y0;
    v0x = x0 - x1;
    v0y = y0 - y1;
    if (v0x * v1y - v1x * v0y < 0) tot++;
  }
  cout << tot << endl;
  return 0;
}
