#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, k = 1;
  scanf("%lld", &t);
  long long int m, n = 1, d = 0, a, b = 9, c = 1, ar[1000], i, j, ans, T, p;
  for (a = 1; a <= 10; a++, n++) {
    ar[a] = (b * n) + d;
    d = ar[a];
    b *= 10;
  }
  if (t < 10) {
    printf("%lld\n", t);
    return 0;
  }
  for (i = 9, j = 0;; j++) {
    if (t < i) {
      for (p = 1, k = 1; k <= j; k++) p *= 10;
      T = (1 + t - p) * (j + 1);
      ans = ar[j] + T;
      break;
    } else if (t == i) {
      ans = ar[j + 1];
    }
    i = (i * 10) + 9;
    c++;
  }
  printf("%lld\n", ans);
  return 0;
}
