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