#include <bits/stdc++.h>
using namespace std;
int n;
pair<int, pair<int, int> > a[100005];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  if (n == 1) {
    cout << 0;
    return 0;
  }
  if (n % 2 == 0) {
    cout << (1LL * (n / 2) - 1) % (n + 1);
    return 0;
  }
  cout << (1LL * (n / 2)) % (n + 1);
  return 0;
}
