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