#include <bits/stdc++.h>
using namespace std;
long long const modul = 1;
long long mod_sum(long long x, long long y) { return (x + y) % modul; }
long long mod_sub(long long x, long long y) {
  if (x > y) {
    return (x - y) % modul;
  } else {
    return (modul + x - y) % modul;
  }
}
long long mod_mpl(long long x, long long y) { return (x * y) % modul; }
void set_precise(int n) {
  cout << fixed;
  cout << setprecision(n);
}
char direct(int x1, int y1, int x2, int y2) {
  if (x1 == x2) {
    if (y2 > y1) {
      return 'n';
    } else {
      return 's';
    }
  }
  if (y1 == y2) {
    if (x2 > x1) {
      return 'e';
    } else {
      return 'w';
    }
  }
  return '0';
}
bool dang(char dir1, char dir2) {
  if ((dir1 == 'n') && (dir2 == 'w')) {
    return 1;
  }
  if ((dir1 == 'w') && (dir2 == 's')) {
    return 1;
  }
  if ((dir1 == 's') && (dir2 == 'e')) {
    return 1;
  }
  if ((dir1 == 'e') && (dir2 == 'n')) {
    return 1;
  }
  return 0;
}
pair<int, int> points[1003];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n + 1; ++i) {
    int x;
    int y;
    cin >> x >> y;
    points[i] = make_pair(x, y);
  }
  int ans = 0;
  for (int i = 1; i < n; ++i) {
    pair<int, int> cur = points[i];
    pair<int, int> next = points[i + 1];
    pair<int, int> prev = points[i - 1];
    char dir1 = direct(prev.first, prev.second, cur.first, cur.second);
    char dir2 = direct(cur.first, cur.second, next.first, next.second);
    if (dang(dir1, dir2)) {
      ++ans;
    }
  }
  cout << ans;
  return 0;
}
