#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, count = 0;
  cin >> n;
  if (n < 10) count = count + (n);
  if (n > 9 && n < 100) count = count + 9 + ((n - 9) * 2);
  if (n > 99 && n < 1000) count = count + 9 + (90 * 2) + ((n - 99) * 3);
  if (n > 999 && n < 10000)
    count = count + 9 + (90 * 2) + (900 * 3) + ((n - 999) * 4);
  if (n > 9999 && n < 100000)
    count = count + 9 + (90 * 2) + (900 * 3) + (9000 * 4) + ((n - 9999) * 5);
  if (n > 99999 && n < 1000000)
    count = count + 9 + (90 * 2) + (900 * 3) + (9000 * 4) + (90000 * 5) +
            ((n - 99999) * 6);
  if (n > 999999 && n < 10000000)
    count = count + 9 + (90 * 2) + (900 * 3) + (9000 * 4) + (90000 * 5) +
            (900000 * 6) + ((n - 999999) * 7);
  if (n > 9999999 && n < 100000000)
    count = count + 9 + (90 * 2) + (900 * 3) + (9000 * 4) + (90000 * 5) +
            (900000 * 6) + (9000000 * 7) + ((n - 9999999) * 8);
  if (n > 99999999 && n < 1000000000)
    count = count + 9 + (90 * 2) + (900 * 3) + (9000 * 4) + (90000 * 5) +
            (900000 * 6) + (9000000 * 7) + (90000000 * 8) +
            ((n - 99999999) * 9);
  if (n == 1000000000)
    count = count + 9 + (90 * 2) + (900 * 3) + (9000 * 4) + (90000 * 5) +
            (900000 * 6) + (9000000 * 7) + (90000000 * 8) +
            ((n - 99999999 - 1) * 9) + 10;
  cout << count;
  return 0;
}
