#include <bits/stdc++.h>
using namespace std;
bool right(pair<int, int> a, pair<int, int> b) {
  return a.second == b.second && b.first > a.first;
}
bool left(pair<int, int> a, pair<int, int> b) {
  return a.second == b.second && b.first < a.first;
}
bool up(pair<int, int> a, pair<int, int> b) {
  return a.first == b.first && b.second > a.second;
}
bool down(pair<int, int> a, pair<int, int> b) {
  return a.first == b.first && b.second < a.second;
}
int main() {
  int n, x, y, ans = 0;
  cin >> n;
  vector<pair<int, int>> v;
  for (int i = 0; i < n + 1; i++) cin >> x >> y, v.push_back({x, y});
  v.insert(v.begin(), v[n - 1]);
  for (int i = 1; i <= n; i++) {
    if ((right(v[i - 1], v[i]) && up(v[i], v[i + 1])) ||
        (left(v[i - 1], v[i]) && down(v[i], v[i + 1])) ||
        (up(v[i - 1], v[i]) && left(v[i], v[i + 1])) ||
        (down(v[i - 1], v[i]) && right(v[i], v[i + 1])))
      ans++;
  }
  cout << ans;
}
