#include <bits/stdc++.h>
using namespace std;
namespace {}
int main() {
  int n;
  cin >> n;
  long long sum = 0;
  for (int i = 9; n > 0; i *= 10) {
    sum += n;
    n -= i;
  }
  cout << sum;
  return 0;
}
