#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long sum = 0;
  long long s = 1;
  for (long long i = 1;; i++) {
    if (n >= s * 10) {
      sum += 9 * s * i;
      s *= 10;
    } else {
      sum += (n - s + 1) * i;
      break;
    }
  }
  cout << sum << endl;
  return 0;
}
