#include <bits/stdc++.h>
int main(int argc, const char* argv[]) {
  int n;
  scanf("%d", &n);
  long long ans = 0;
  for (int k = 0; n > k; k = 10 * k + 9) ans += n - k;
  printf("%I64d", ans);
  return 0;
}
