#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, ans, s, t;
  while (~scanf("%I64d", &n)) {
    ans = 0;
    s = 1;
    t = 0;
    while (n - s >= 0) {
      ans += n - s + 1;
      s *= 10;
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
