#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
long long a[maxn], b[maxn];
int m;
int judge(int x1, int y1, int x2, int y2, int x3, int y3) {
  if ((x2 - x1) * (y3 - y2) - (y2 - y1) * (x3 - x2) > 0)
    return 1;
  else
    return 0;
}
void init() {
  int ans = 0;
  for (int i = 1; i <= m + 1; i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 2; i <= m; i++) {
    if (judge(a[i - 1], b[i - 1], a[i], b[i], a[i + 1], b[i + 1])) ans++;
  }
  cout << ans << endl;
}
int main() {
  while (~scanf("%d", &m)) {
    init();
  }
  return 0;
}
