#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  if (n < 10) {
    cout << n << endl;
    return 0;
  }
  long long int d = n;
  long long int len = 0, sum = 9;
  while (n != 0) {
    n /= 10;
    len++;
  }
  long long int j = 1;
  for (long long int i = 2; i < len; i++) {
    j *= 10;
    sum += (9 * i * j);
  }
  long long int e = 1;
  for (long long int i = 1; i < len; i++) e = e * 10;
  sum += ((d - e + 1) * len);
  cout << sum << endl;
}
