#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5;
const long long INF = 1e9 + 5;
const long long MOD = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  ifstream inf("input.txt");
  long long n;
  cin >> n;
  long long t = 1, ans = 0;
  for (int i = 1; t <= n; i++) {
    ans += (min(t * 10, n + 1) - t) * i;
    t = t * 10;
  }
  cout << ans;
}
