#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
} a[1010];
int n;
int main() {
  int i, j, k;
  while (cin >> n) {
    for (i = 0; i <= n; ++i) cin >> a[i].x >> a[i].y;
    a[n + 1].x = a[1].x;
    a[n + 1].y = a[1].y;
    int num = 0;
    for (i = 1; i <= n; ++i) {
      if (a[i].x > a[i - 1].x && a[i].y == a[i - 1].y && a[i + 1].x == a[i].x &&
          a[i + 1].y > a[i].y)
        num++;
      if (a[i].x == a[i - 1].x && a[i].y < a[i - 1].y && a[i + 1].x > a[i].x &&
          a[i + 1].y == a[i].y)
        num++;
      if (a[i].x < a[i - 1].x && a[i].y == a[i - 1].y && a[i + 1].x == a[i].x &&
          a[i + 1].y < a[i].y)
        num++;
      if (a[i].x == a[i - 1].x && a[i].y > a[i - 1].y && a[i + 1].x < a[i].x &&
          a[i + 1].y == a[i].y)
        num++;
    }
    cout << num << endl;
  }
  return 0;
}
