#include <bits/stdc++.h>
#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const int INF = 2e9;
const long long LINF = 2e18;
template <typename T>
void print(vector<T>& a) {
  for (int i = 0; i < a.size(); i++) cout << a[i] << ' ';
}
template <typename T>
void input(vector<T>& a) {
  for (int i = 0; i < a.size(); i++) cin >> a[i];
}
struct dot {
  int x, y;
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  n++;
  vector<dot> a(n);
  for (int i = 0; i < n; i++) cin >> a[i].x >> a[i].y;
  int ans = 0;
  for (int i = 0; i < n - 2; i++) {
    int x1 = a[i + 1].x - a[i].x;
    int y1 = a[i + 1].y - a[i].y;
    int x2 = a[i + 2].x - a[i + 1].x;
    int y2 = a[i + 2].y - a[i + 1].y;
    if (x1 < 0 && y1 == 0)
      if (x2 == 0 && y2 < 0) ans++;
    if (x1 == 0 && y1 > 0)
      if (x2 < 0 && y2 == 0) ans++;
    if (x1 > 0 && y1 == 0)
      if (x2 == 0 && y2 > 0) ans++;
    if (x1 == 0 && y1 < 0)
      if (x2 > 0 && y2 == 0) ans++;
  }
  cout << ans;
}
