#include <bits/stdc++.h>
using namespace std;
int p[200000], r[200000], usize;
int parent(int i) {
  if (p[i] == i)
    return i;
  else
    return p[i] = parent(p[i]);
}
inline bool UN(int a, int b) {
  int A = parent(a), B = parent(b);
  if (A == B) return false;
  --usize;
  if (r[A] < r[B])
    p[A] = p[B];
  else
    r[A] += r[A] == r[B], p[B] = p[A];
  return true;
}
void init(int N) {
  usize = N;
  for (int i = (1); i < (N); ++i) p[i] = i, r[i] = 0;
}
int main() {
  long long(n);
  scanf("%lld", &n);
  ++n;
  init(n);
  long long cost = 0;
  while (1) {
    for (long long c = 0;; ++c) {
      for (long long a = 1; a < n; ++a) {
        long long b = (c - a + n) % n;
        if (b == 0) continue;
        if (UN(a, b)) cost += c;
        if (usize == 2) {
          return 0 * printf("%lld\n", cost);
        }
      }
    }
  }
}
