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