#include <bits/stdc++.h>
using namespace std;
long long arr[12];
int main() {
  long long n;
  cin >> n;
  long long sum = 0;
  for (long long i = 1, m = 1; i < 12; i++) {
    arr[i] = arr[i - 1] + (9 * m);
    m = m * 10;
  }
  for (long long i = 1;; i++) {
    if (n > arr[i]) {
      sum = sum + (arr[i] - arr[i - 1]) * i;
    } else {
      sum = sum + (n - arr[i - 1]) * i;
      break;
    }
  }
  cout << sum << "\n";
  return 0;
}
