#include <bits/stdc++.h>
int x[1005], y[1005];
using namespace std;
int main() {
  int n, cont = 0;
  char direction, danger;
  cin >> n;
  for (int i = 0; i <= n; ++i) {
    cin >> x[i] >> y[i];
  }
  for (int i = 1; i < n; ++i) {
    if (x[i + 1] - x[i] > 0) {
      danger = 'S';
    } else if (x[i + 1] - x[i] < 0) {
      danger = 'N';
    } else if (y[i + 1] - y[i] > 0) {
      danger = 'E';
    } else {
      danger = 'W';
    }
    if (x[i] - x[i - 1] > 0) {
      direction = 'E';
    } else if (x[i] - x[i - 1] < 0) {
      direction = 'W';
    } else if (y[i] - y[i - 1] > 0) {
      direction = 'N';
    } else {
      direction = 'S';
    }
    if (danger == direction) ++cont;
  }
  cout << cont << endl;
  return 0;
}
