#include <bits/stdc++.h>
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
  long long n, d = 0;
  std::cin >> n;
  for (long long i = 1; i <= n; i *= 10) d += n - i + 1;
  std::cout << d << '\n';
}
