#include <bits/stdc++.h>
using namespace std;

int main(void) {
    int n; cin>> n;
    cout << n - 1 << endl;
}
#include <bits/stdc++.h>

using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define debug(output) if(debugFlag)cout<<#output<<"= "<<output<<endl
using lint = long long;
typedef pair<int,int> P;
const bool debugFlag=true;
const lint linf=1e18+7;
const lint inf=1e9+7;
const int MOD=1000000007;
signed main(){
  int n;cin>>n;
  cout<<max(0,n-1)<<endl;
  return 0;
}