#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  if (n < 10) {
    cout << n << endl;
    return 0;
  }
  string s = to_string(n);
  int l = s.size();
  long long sum = 0, i, p = 1;
  s = "";
  for (i = 1; i < l; i++) sum += (9 * p * i), p *= 10, s += '9';
  long long a = stol(s);
  cout << sum + (n - a) * l << endl;
  return 0;
}
