#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
const long long mod = 1e9 + 7;
const int MAX = 300009;
long long n;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  long long t = 9, ans = 0, c = 1;
  while (n - t > 0) {
    ans += t * c;
    n -= t;
    t *= 10;
    c++;
  }
  ans += max(0ll, n * c);
  cout << ans;
}
