#include <bits/stdc++.h>
using namespace std;
int n, pot = 0;
long long int ans = 0, x = 1;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  while (x <= n) {
    pot++;
    ans += (x * 10 - x) * pot;
    x *= 10;
  }
  ans -= (x - n - 1) * pot;
  cout << ans << "\n";
}
