#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e3 + 10;
const int pN = 1e6;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
void add(long long &x, long long y) {
  x += y;
  x %= MOD;
}
int n;
int x[MAXN], y[MAXN];
map<pair<int, int>, bool> fp;
bool pointInPolygon(int xx, int yy) {
  int i, j = n - 1;
  bool flag = false;
  for (i = 0; i < n; i++) {
    if ((y[i] < yy && y[j] >= yy || y[j] < yy && y[i] >= yy) &&
        (x[i] <= xx || x[j] <= xx)) {
      flag ^= (x[i] + (yy - y[i]) / (y[j] - y[i]) * (x[j] - x[i]) < xx);
    }
    j = i;
  }
  flag &= (fp[pair<int, int>(xx, yy)] == false);
  return flag;
}
bool judge(int x1, int y1, int x2, int y2) {
  int xx, yy;
  if (x1 == x2) {
    xx = x1;
    yy = y2 + (y2 - y1) / abs(y2 - y1);
  } else {
    yy = y1;
    xx = x2 + (x2 - x1) / abs(x2 - x1);
  }
  return pointInPolygon(xx, yy);
}
int main() {
  scanf("%d", &n);
  n++;
  fp.clear();
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &x[i], &y[i]);
    fp[pair<int, int>(x[i], y[i])] = true;
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (i == 0) continue;
    ans += judge(x[i - 1], y[i - 1], x[i], y[i]);
  }
  printf("%d\n", ans);
  return 0;
}
