#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long ans = 0;
  long long tenPower = 1;
  long long numDigits = 1;
  while (tenPower * 10 <= n) {
    ans += numDigits * tenPower * 9;
    tenPower *= 10, numDigits++;
  }
  ans += (n - tenPower + 1) * numDigits;
  cout << ans << endl;
  return 0;
}
