#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, count = 0, sum = 0, a = 1, sum1 = 0;
  cin >> n;
  for (long long i = n; i > 0; i /= 10) {
    count++;
  }
  for (long i = 1; i < count; i++) {
    sum = sum + 9 * a * i;
    sum1 = sum1 + 9 * a;
    a = a * 10;
  }
  if (count != 1) {
    sum = sum + (n - sum1) * count;
    cout << sum;
  } else {
    cout << n;
  }
}
