#include <bits/stdc++.h>
using namespace std;
long long numberDigits(long long n) {
  long long count = 0;
  while (n != 0) {
    n /= 10L;
    count++;
  }
  return count;
}
int main() {
  long long n;
  cin >> n;
  long long digits = numberDigits(n);
  long long cur = 1;
  long long count = 0;
  for (long long i = 1; i < digits; i++) {
    count += (cur * 10 - cur) * i;
    cur *= 10;
  }
  count += (n - cur + 1L) * digits;
  cout << count << endl;
}
