#include <bits/stdc++.h>
int main() {
  long long int n;
  int mult = 1;
  long long int consti = 9;
  scanf("%lld", &n);
  long long int result = 0;
  while (true) {
    if (n <= consti) {
      result += (n * mult);
      break;
    } else {
      result += consti * mult;
      n -= consti;
      consti *= 10;
      mult++;
    }
  }
  printf("%lld\n", result);
  return 0;
}
