#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200060;
int n;
char data[MAXN];
int main() {
  scanf("%d", &n);
  if (n == 1) {
    printf("0");
    return 0;
  }
  if (n & 1) {
    int val = 0x3f3f3f3f;
    for (int i = 1; i <= n; ++i) {
      if (i == (n + 1) / 2) {
        continue;
      }
      val = min(val, (i + (n + 1) / 2) % (n + 1));
    }
    printf("%d", n / 2 - 1 + val);
  } else {
    printf("%d", n / 2 - 1);
  }
}
