/*

    author: Taka007

    2021.04.11 start

*/

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

int64_t Fac(int k)         // Definition of "Factorial"
{        
  return(k==0 ? 1 : k*Fac(k-1));
}

int   sum(int l)        // Definition of "Sum total"

{        
  return l*(l+1)/2;
}

int64_t Abs(int m)        // Definition of "Absolute value"

{
    if(m>=0)
  {
    return m;
  }

    else
  {
    return m*(-1);
  }

}


int main(){
  
  
  int n;

  cin>>n;

  int answer;

  answer=(n-1);

  cout<<answer<<endl;


return 0;



}
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define ll long long
using namespace std;
using P = pair<int, int>;

int main(){
    int n; 
    cin >> n;
    if(n==1) cout << 0 << endl;
    else{
        cout << n-1 << endl;
    }
}