#include <bits/stdc++.h>
using namespace std;
long long res[10];
int main() {
  long long d = 9;
  for (long long i = 1; i < 10; i++) {
    res[i] = res[i - 1] + i * d;
    d *= 10;
  }
  long long n;
  cin >> n;
  long long t = 10, p = 0;
  while ((n - 1) / t) {
    t *= 10;
    p++;
  }
  cout << res[p] + (p + 1) * (n - t / 10) + (n == t ? p + 2 : p + 1) << endl;
  return 0;
}
