#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, ans = 0;
  pair<int, int> directions[] = {pair<int, int>(0, 1), pair<int, int>(-1, 0),
                                 pair<int, int>(0, -1), pair<int, int>(1, 0)};
  cin >> n;
  pair<int, int> cur_p, pre_p, cur_dir, pre_dir;
  for (int i = 0; i < (n); i++) {
    int x, y;
    cin >> x >> y;
    cur_p = pair<int, int>(x, y);
    if (i == 0) pre_p = cur_p;
    cur_dir =
        pair<int, int>(cur_p.first - pre_p.first, cur_p.second - pre_p.second);
    if (cur_dir.first != 0) cur_dir.first /= abs(cur_dir.first);
    if (cur_dir.second != 0) cur_dir.second /= abs(cur_dir.second);
    for (int j = 0; j < (4); j++) {
      if (directions[j] == pre_dir && directions[(j + 1) % 4] == cur_dir) {
        ans++;
        break;
      }
    }
    pre_p = cur_p;
    pre_dir = cur_dir;
  }
  cout << ans << endl;
  return 0;
}
