#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
int main() {
  int n;
  int x1, y1, x2, y2;
  int res = 0;
  cin >> n;
  ++n;
  vector<vector<int>> data(n);
  for (auto i(0); i < n; ++i) {
    data[i].resize(2);
    cin >> data[i][0] >> data[i][1];
  }
  for (auto i(1); i <= n - 2; ++i) {
    x1 = data[i][0] - data[i - 1][0];
    y1 = data[i][1] - data[i - 1][1];
    x2 = data[i + 1][0] - data[i][0];
    y2 = data[i + 1][1] - data[i][1];
    if ((x1 * y2 - x2 * y1) > 0) {
      ++res;
    }
  }
  cout << res << endl;
  return 0;
}
