#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  scanf("%d", &n);
  long long a[10], ans = 0, temp = 1;
  a[0] = 0;
  for (i = 1; i < 10; i++) {
    a[i] = a[i - 1] + 9LL * temp * i;
    temp *= 10;
  }
  temp = 1000000000;
  for (i = 9; i >= 0; i--) {
    if (n >= temp) {
      ans = 1LL * (i + 1) * (n - temp + 1) + a[i];
      break;
    }
    temp /= 10;
  }
  printf("%I64d\n", ans);
}
