#include <bits/stdc++.h>
using namespace std;
const long double pi = 2 * acos(0);
const int N = 111111;
const int MOD = 1e9 + 7;
int n;
int x[1111], y[1111];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long cnt = 0;
  cin >> n;
  for (int i = 0; i <= n; ++i) cin >> x[i] >> y[i];
  for (int i = 1; i < n - 1; ++i) {
    if (y[i] == y[i - 1]) {
      if (x[i - 1] < x[i]) {
        if (y[i + 1] > y[i]) cnt++;
      }
      if (x[i - 1] > x[i]) {
        if (y[i + 1] < y[i]) cnt++;
      }
    }
    if (y[i] == y[i + 1]) {
      if (x[i] < x[i + 1]) {
        if (y[i - 1] > y[i]) cnt++;
      }
      if (x[i] > x[i + 1]) {
        if (y[i - 1] < y[i]) cnt++;
      }
    }
  }
  cout << cnt;
}
