#include <bits/stdc++.h>
using namespace std;
long long n, d[12], tmp, a[12], top = 0;
long long pow_10(long long k) {
  long long res = 1;
  while (k--) {
    res *= 10;
  }
  return res;
}
int main() {
  d[0] = 0;
  d[1] = 9;
  tmp = 10;
  for (int i = 2; i <= 10; i++) {
    d[i] = d[i - 1] + 9LL * tmp * i;
    tmp *= 10LL;
  }
  cin >> n;
  long long m = n;
  while (m > 0) {
    a[top++] = m % 10;
    m /= 10;
  }
  if (n < 10) {
    cout << n << endl;
    return 0;
  }
  long long ans = 0;
  long long k = pow_10(top - 1);
  ans = (n - k + 1) * top + d[top - 1];
  cout << ans << endl;
  return 0;
}
