#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int di, l, k, cnt = 0, n;
  scanf("%lld", &n);
  while (n != 0) {
    di = floor(log10(n)) + 1;
    l = pow(10, di - 1);
    k = abs(l - n) + 1;
    cnt += (k * di);
    n = l;
    n--;
  }
  printf("%lld\n", cnt);
  return 0;
}
