#include <bits/stdc++.h>
using namespace std;
long long int digit(long long int m) {
  long long int i, c = 0;
  while (m) {
    c++;
    m /= 10;
  }
  return c;
}
int main() {
  long long int n, i, j, k, count1, x, ans = 0;
  cin >> n;
  while (1) {
    if (n < 10) break;
    count1 = digit(n);
    if (count1 == 10) {
      x = n - 999999999;
      ans += 10 * x;
      n = n - x;
      x = 0;
    } else if (count1 == 9) {
      x = n - 99999999;
      ans += 9 * x;
      n = n - x;
      x = 0;
    } else if (count1 == 8) {
      x = n - 9999999;
      ans += 8 * x;
      n = n - x;
      x = 0;
    } else if (count1 == 7) {
      x = n - 999999;
      ans += 7 * x;
      n = n - x;
      x = 0;
    } else if (count1 == 6) {
      x = n - 99999;
      ans += 6 * x;
      n = n - x;
      x = 0;
    } else if (count1 == 5) {
      x = n - 9999;
      ans += 5 * x;
      n = n - x;
      x = 0;
    } else if (count1 == 4) {
      x = n - 999;
      ans += 4 * x;
      n = n - x;
      x = 0;
    } else if (count1 == 3) {
      x = n - 99;
      ans += 3 * x;
      n = n - x;
      x = 0;
    } else if (count1 == 2) {
      x = n - 9;
      ans += 2 * x;
      n = n - x;
      x = 0;
    }
  }
  cout << ans + n << '\n';
}
