#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n, nn, d = 0, largest = 9, sum = 0, cnt = 9, i;
  cin >> n;
  nn = n;
  while (n) {
    d++;
    n /= 10;
  }
  for (i = 1; i < d; i++) {
    largest = largest * 10 + 9;
    sum += cnt * i;
    cnt *= 10;
  }
  sum += cnt * i;
  cout << sum - (largest - nn) * i;
  return 0;
}
