#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, x, sum = 0;
  cin >> n;
  x = floor(log10(n)) + 1;
  while (x > 0) {
    x--;
    long long int k = pow(10, x);
    k -= 1;
    sum += (n - k) * (x + 1);
    n -= (n - k);
  }
  cout << sum << endl;
}
