#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, ans = 0, power = 10;
  cin >> n;
  for (long long i = 1;; i++) {
    if (n >= power) {
      ans += power / 10 * 9 * i;
    } else {
      long long num = n - power / 10 + 1;
      ans += num * i;
      break;
    }
    power *= 10;
  }
  cout << ans << endl;
}
