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