#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5;
const long long M = 20;
const long long SQ = 320;
const long long INF = 1e16;
const long long MOD = 1e9 + 7;
int n;
int x[N], y[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  int t;
  cin >> t >> t;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int p1 = (i - 1 + n) % n, p2 = (i + 1) % n;
    if (y[i] == y[p1]) {
      if ((x[p1] < x[i] && y[p2] > y[i]) || (x[p1] > x[i] && y[p2] < y[i]))
        ans++;
    } else {
      if ((y[p1] < y[i] && x[p2] < x[i]) || (y[p1] > y[i] && x[p2] > x[i]))
        ans++;
    }
  }
  cout << ans << '\n';
  return 0;
}
