#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int x[1003], y[1003];
  cin >> n;
  for (int i = 0; i <= n; i++) {
    cin >> x[i] >> y[i];
  }
  int left = 0;
  int right = 0;
  int r = 0;
  int l = 0;
  for (int i = 0; i <= n - 1; i++) {
    int j = (i + 1) % n;
    int k = (i + 2) % n;
    if ((x[i] == x[j]) && (y[j] == y[k])) {
      if (y[1 + i] > y[i]) {
        if (x[k] > x[j]) {
          right += 90;
          left += 270;
          l++;
        } else {
          right += 270;
          left += 90;
          r++;
        }
      } else {
        if (x[k] > x[j]) {
          right += 270;
          left += 90;
          r++;
        } else {
          left += 270;
          right += 90;
          l++;
        }
      }
    } else if (y[i] == y[(j) % n] && x[(j) % n] == x[(k) % n]) {
      if (x[j] > x[i]) {
        if (y[k] > y[j]) {
          right += 270;
          left += 90;
          r++;
        } else {
          left += 270;
          right += 90;
          l++;
        }
      } else {
        if (y[k] > y[j]) {
          right += 90;
          left += 270;
          l++;
        } else {
          right += 270;
          left += 90;
          r++;
        }
      }
    }
  }
  int ans = 0;
  if (left < right) {
    ans = l;
  } else
    ans = r;
  cout << ans << endl;
  return 0;
}
