#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long ans, p, n, k;
  cin >> n;
  p = 10;
  k = 0;
  while (n / p != 0) {
    p *= 10;
    k++;
  }
  p = p / 10;
  ans = k * p - (p - 1) / 9 + (n - p + 1) * (k + 1);
  cout << ans;
  return 0;
}
