#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  long long n;
  cin >> n;
  long long kol = 9, i = 1, ans = 0;
  while (n > 0) {
    ans += min(kol, n) * i;
    n -= min(kol, n);
    kol = kol * 10;
    i++;
  }
  cout << ans;
}
