#include <bits/stdc++.h>
using namespace std;
long long a[11];
long long b[11];
long long c[11];
int main() {
  long long n;
  cin >> n;
  long long res;
  long long m = n;
  long long nish = 0;
  while (m > 0) {
    nish++;
    m = m / 10;
  }
  a[1] = 1;
  b[1] = 9;
  c[1] = 9;
  for (int i = 2; i < 11; i++) {
    a[i] = 10 * a[i - 1];
    b[i] = 10 * b[i - 1] + 9;
    c[i] = b[i] - a[i] + 1;
  }
  long long sum = 0;
  for (int i = 1; i <= nish; i++) {
    if (i == nish) {
      sum += (n - a[i] + 1) * nish;
    } else {
      sum += i * c[i];
    }
  }
  cout << sum << endl;
  return 0;
}
