#include <bits/stdc++.h>
using namespace std;
int main() {
  double L, n;
  cin >> L;
  int l = L;
  int j = 0;
  while (l >= 10) {
    j++;
    l /= 10;
  }
  n = double(j);
  double ans = 0.0;
  for (double i = 1; i <= n; i++) ans += i * 9 * pow(10.0, i - 1);
  ans += (L + 1.0 - pow(10.0, n)) * (n + 1.0);
  long long sum = ans;
  cout << sum << endl;
}
