#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using ll = long long;
using vl = vector<long long>;
using vi = vector<int>;

int main(){
    ll n; cin >> n;
    ll ans = 0;
    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 << endl;
    
}
#include<bits/stdc++.h>
#define fio ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;
int main()
{
    fio;
    long long n;
    cin>>n;
    long long sum=0;
    long long i=0;
    while(sum<n)
    {
        i++;
        sum=sum+i;
    }
   cout<<i;

}