#include <bits/stdc++.h>
using namespace std;
long long func(long long n) {
  long long i, j, fl, sum, count;
  if (n <= 9)
    return n;
  else if (n > 9 && n <= 99) {
    fl = n - 10 + 1;
    sum = 2 * fl + func(9);
    return sum;
  } else if (n > 99 && n <= 999) {
    fl = n - 100 + 1;
    sum = 3 * fl + func(99);
    return sum;
  } else if (n > 999 && n <= 9999) {
    fl = n - 1000 + 1;
    sum = 4 * fl + func(999);
    return sum;
  } else if (n > 9999 && n <= 99999) {
    fl = n - 10000 + 1;
    sum = 5 * fl + func(9999);
    return sum;
  } else if (n > 99999 && n <= 999999) {
    fl = n - 100000 + 1;
    sum = 6 * fl + func(99999);
    return sum;
  } else if (n > 999999 && n <= 9999999) {
    fl = n - 1000000 + 1;
    sum = 7 * fl + func(999999);
    return sum;
  } else if (n > 9999999 && n <= 99999999) {
    fl = n - 10000000 + 1;
    sum = 8 * fl + func(9999999);
    return sum;
  } else if (n > 99999999 && n <= 999999999) {
    fl = n - 100000000 + 1;
    sum = 9 * fl + func(99999999);
    return sum;
  } else if (n = 1000000000) {
    sum = 10 + func(999999999);
    return sum;
  }
}
int main() {
  long long i, j, k, x, y, z, fl, sum, count, n;
  scanf("%lld", &n);
  printf("%lld", func(n));
  return 0;
}
