#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n = 0;
  long long t = 0;
  int l = 0;
  long long sum = 0;
  cin >> n;
  t = n;
  while (n > 0) {
    n /= 10;
    l++;
  }
  for (int i = 1; i < l; i++) {
    sum += ((pow(10, i) - 1 - pow(10, i - 1)) + 1) * i;
  }
  sum += (t - pow(10, l - 1) + 1) * l;
  cout << sum;
}
