#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long d = 0;
  long long a = 9, b = 1;
  while (n > 0) {
    if (n > a) {
      d = d + a * b;
      n = n - a;
    } else {
      d = d + b * n;
      n = 0;
    }
    a = a * 10;
    b++;
  }
  cout << d;
}
