#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  long long cur = 1;
  long long curm = 1;
  long long z = 1;
  long long ans = 0;
  while (curm <= n) {
    curm *= 10;
    ans += min(curm - cur, n - cur + 1) * z;
    z++;
    cur = curm;
  }
  cout << ans << endl;
  cin.get();
  cin.get();
  return 0;
}
