#include <bits/stdc++.h>
using namespace std;
int sgn(int v) {
  if (v == 0)
    return 0;
  else if (v > 0)
    return +1;
  else
    return -1;
}
int main() {
  int n;
  cin >> n;
  int ans = 0;
  vector<vector<int>> points(n + 1, vector<int>(2));
  for (int i = 0; i < n + 1; i++) cin >> points[i][0] >> points[i][1];
  for (int i = 1; i <= n - 1; i++) {
    int x = points[i - 1][0], y = points[i - 1][1];
    int x1 = points[i][0], y1 = points[i][1];
    int x2 = points[i + 1][0], y2 = points[i + 1][1];
    int lastAns = ans;
    if (x1 == x && sgn(y1 - y) == +1 && sgn(x2 - x1) == -1 && (y2 - y1) == 0)
      ans++;
    else if (sgn(x1 - x) == +1 && y1 == y && sgn(x2 - x1) == 0 &&
             sgn(y2 - y1) == +1)
      ans++;
    else if (x1 == x && sgn(y1 - y) == -1 && sgn(x2 - x1) == +1 &&
             sgn(y2 - y1) == 0)
      ans++;
    else if (sgn(x1 - x) == -1 && y1 == y && sgn(x2 - x1) == 0 &&
             sgn(y2 - y1) == -1)
      ans++;
    else {
      ans += 0;
    }
  }
  cout << ans << endl;
  return 0;
}
