#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, ans = 0;
  cin >> n;
  long long m = n;
  n /= 10;
  int count = 0;
  while (n) {
    n /= 10;
    ++count;
  }
  long long p = 1;
  long long nr = 1;
  for (int i = 1; i <= count; ++i) {
    ans += 9 * p * nr;
    ++nr;
    p *= 10;
  }
  m = m - p + 1;
  ans += nr * m;
  cout << ans;
}
