#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int m = 9, ans = 0, r = 0, x = 1;
  for (int i = 0; i < 10; i++, x *= 10)
    if (n / x) r++;
  for (int i = 1; i < r; i++) ans += i * m, n -= m, m *= 10;
  return cout << ans + r * n << '\n', 0;
}
