#include <bits/stdc++.h>
using namespace std;
int num(int i) { return i > 0 ? (int)log10((double)i) + 1 : 1; }
int main() {
  long long arr[10] = {9,      90,      900,      9000,      90000,
                       900000, 9000000, 90000000, 900000000, 9000000000};
  long long a[10] = {9,      99,      999,      9999,      99999,
                     999999, 9999999, 99999999, 999999999, 9999999999};
  int n;
  long long sum = 0;
  cin >> n;
  int t = num(n);
  if (t == 1) {
    cout << n << "\n";
  } else {
    for (int i = 1; i < t; i++) {
      sum += arr[i - 1] * i;
    }
    sum = sum + (n - a[t - 2]) * t;
    cout << sum << "\n";
  }
  return 0;
}
