#include <bits/stdc++.h>
using namespace std;
unsigned long long arr[9] = {9,      99,      999,      9999,     99999,
                             999999, 9999999, 99999999, 999999999};
int main() {
  int n;
  unsigned long long sum = 0;
  scanf("%d", &n);
  while (n > 9) {
    for (int i = 8; i >= 0; --i) {
      if (n > arr[i]) {
        sum = sum + (n - arr[i]) * (i + 2);
        n = arr[i];
        break;
      }
    }
  }
  if (n != 0) sum = sum + n;
  cout << sum;
  return 0;
}
