#include<iostream>
using namespace std;
int main()
{
	int n;
	cin>>n;
	cout<<n-1; 
	return 0;
 } 
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
using namespace std;
int main(){
    ll n,ans=0;
    cin >> n;
    if(n>999){
        ans+=n-999;
    }if(n>999999){
        ans+=n-999999;
    }if(n>999999999){
        ans+=n-999999999;
    }if(n>999999999999){
        ans+=n-999999999999;
    }if(n>999999999999999){
        ans+=n-999999999999999;
    }
    cout << ans;
}