#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <stdio.h>
using ll=long long;
using namespace std;
 

int main(){
  ll n;
  cin>>n;
  ll x=1000;
  ll ans=0;
  while(n>=x){
    ans+=n-x+1;
    x*=1000;
  }
  cout<<ans<<endl;
}

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

int main() {
    string x;
    cin >> x;
    int n = x.find('.');
    cout << x.substr(0,n) << endl;
    return 0;
}