#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, k = 1, a = 0, l = 0, s, m, d;
  cin >> s;
  m = s;
  while (m > 0) {
    m = m / 10, l++;
  }
  for (i = 1; i < l; i++) {
    a = (9 * k) * i + a;
    k = k * 10;
  }
  d = (s - k + 1) * l;
  j = d + a;
  cout << j;
  return 0;
}
