#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, s = 0, p = 9, i;
  cin >> n;
  for (i = 1;; ++i) {
    if (n >= p) {
      n = n - p;
      s = s + p * i;
      p = p * 10;
    } else
      break;
  }
  s = s + n * i;
  cout << s << endl;
  return 0;
}
