#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i = 9, y = 0, x;
  cin >> x;
  while (x > 0) {
    y = y + x;
    x = x - i;
    i = i * 10;
  }
  cout << y << endl;
  return 0;
}
