#include <bits/stdc++.h>
int main() {
  long long ans = 0;
  long long num, k = 10;
  scanf("%I64d", &num);
  for (int i = 1; i <= 9; i++, k = k * 10) {
    if (num >= k)
      ans += (k - (k / 10)) * i;
    else {
      ans += (num - (k / 10) + 1) * i;
      break;
    }
  }
  if (num == 1e9) ans += 10;
  printf("%I64d", ans);
}
