#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
struct node {
  int x, y;
} p[N];
struct sgment {
  int t, l, r, q;
} s[N];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 0; i <= n; i++) {
    scanf("%d%d", &p[i].x, &p[i].y);
  }
  for (int i = 0; i < n; i++) {
    if (p[i].x == p[i + 1].x) {
      s[i].t = 0, s[i].l = p[i].y, s[i].r = p[i + 1].y, s[i].q = p[i].x;
    } else {
      s[i].t = 1, s[i].l = p[i].x, s[i].r = p[i + 1].x, s[i].q = p[i].y;
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (s[i].t == 1 &&
        (s[i].l - s[i].r) * (s[(i + 1) % n].l - s[(i + 1) % n].r) > 0)
      ans++;
    if (s[i].t == 0 &&
        (s[i].l - s[i].r) * (s[(i + 1) % n].l - s[(i + 1) % n].r) < 0)
      ans++;
  }
  cout << ans << endl;
  return 0;
}
