#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  std::ios_base::sync_with_stdio(false);
  cin >> n;
  long long k = 0;
  long long c;
  long long prev = 0;
  long long sum = 0;
  long long i;
  for (i = 9;; i = i * 10 + 9) {
    k++;
    if (n >= i) {
      sum += (i - prev) * k;
      prev = i;
    } else {
      c = prev;
      break;
    }
  }
  sum += (n - prev) * k;
  cout << sum << endl;
}
