#include<iostream>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<algorithm>
#include<queue>
#include<list>
#include<stack>
#include<cstdio>
#include<fstream>
#include<numeric>
#include<functional>
#include<utility>
#include<memory>
#include<iomanip>
using namespace std;
int n;
int main(){
while (cin >> n){
int left = 1;
int right = n;
int total = 0;
int cur = 1;
bool flag = true;
while (left < right){
if (flag){
int temp = (cur + right) % (n + 1);
total += temp;
cur = right;
left++;
flag = false;
}
else{
int temp = (cur + left) % (n + 1);
total += temp;
cur = left;
right--;
flag = true;
}
}
cout << total << endl;
}
return 0;
}