#include <bits/stdc++.h>
using namespace std;
constexpr size_t min(size_t a, size_t b) { return a < b ? a : b; }
constexpr size_t max(size_t a, size_t b) { return a > b ? a : b; }
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  ++n;
  vector<pair<int, int>> coords(n);
  for (size_t i{0}; i < n; i++) {
    cin >> coords[i].first >> coords[i].second;
  }
  int currentDir{0}, ans{0};
  for (size_t i{1}; i < n; i++) {
    int newDir;
    if (coords[i].first > coords[i - 1].first) {
      newDir = 1;
    } else if (coords[i].first < coords[i - 1].first) {
      newDir = 3;
    }
    if (coords[i].second > coords[i - 1].second) {
      newDir = 0;
    } else if (coords[i].second < coords[i - 1].second) {
      newDir = 2;
    }
    if (newDir != (currentDir + 1) % 4) ++ans;
    currentDir = newDir;
  }
  cout << ans - 1 << endl;
  return 0;
}
