#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 23;
const int MOD = 1e9 + 7;
int n, ans;
int x[100000 + 23];
int y[100000 + 23];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n + 1; i++) {
    cin >> x[i] >> y[i];
  }
  for (int i = 2; i < n; i++) {
    if (x[i] > x[i - 1] && y[i] < y[i + 1]) ans++;
    if (y[i] < y[i - 1] && x[i] < x[i + 1]) ans++;
    if (x[i] < x[i - 1] && y[i] > y[i + 1]) ans++;
    if (y[i] > y[i - 1] && x[i] > x[i + 1]) ans++;
  }
  cout << ans << endl;
  return 0;
}
