#include <bits/stdc++.h>
using namespace std;
int dir[10004];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, c = 0, d = 0, e = 0, first = 0, l = 0, r = 0;
  cin >> n;
  for (int i = 0; i <= n; i++) {
    int a, b;
    cin >> a >> b;
    if (i == 0) {
      c = a;
      d = b;
      e = a;
      first = b;
      continue;
    }
    if (c == a && b > d) {
      dir[i] = 1;
    } else if (c == a && b < d) {
      dir[i] = 3;
    } else if (c > a && b == d) {
      dir[i] = 4;
    } else if (c < a && b == d) {
      dir[i] = 2;
    }
    c = a;
    d = b;
  }
  for (int i = 2; i <= n; i++) {
    if (dir[i - 1] == 1 && dir[i] == 2) {
      r++;
    } else if (dir[i - 1] == 1 && dir[i] == 4) {
      l++;
    } else if (dir[i - 1] == 2 && dir[i] == 1) {
      l++;
    } else if (dir[i - 1] == 2 && dir[i] == 3) {
      r++;
    } else if (dir[i - 1] == 3 && dir[i] == 4) {
      r++;
    } else if (dir[i - 1] == 3 && dir[i] == 2) {
      l++;
    } else if (dir[i - 1] == 4 && dir[i] == 3) {
      l++;
    } else if (dir[i - 1] == 4 && dir[i] == 1) {
      r++;
    }
  }
  if (dir[n] == 1 && dir[1] == 2) {
    r++;
  } else if (dir[n] == 1 && dir[1] == 4) {
    l++;
  } else if (dir[n] == 2 && dir[1] == 1) {
    l++;
  } else if (dir[n] == 2 && dir[1] == 3) {
    r++;
  } else if (dir[n] == 3 && dir[1] == 4) {
    r++;
  } else if (dir[n] == 3 && dir[1] == 2) {
    l++;
  } else if (dir[n] == 4 && dir[1] == 3) {
    l++;
  } else if (dir[n] == 4 && dir[1] == 1) {
    r++;
  }
  cout << min(l, r);
  return 0;
}
