#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int r = 0, n, d = 1;
  cin >> n;
  int i = 1, c = 0;
  while (d != 0) {
    d = n / i;
    if (d != 0) {
      i = i * 10;
      c++;
    }
  }
  for (i = 1; i < c; i++) {
    r += ((pow(10, i) - 1) - (pow(10, i - 1) - 1)) * i;
  }
  r += (n - (pow(10, c - 1) - 1)) * (c);
  cout << r << endl;
  return 0;
}
