#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, n1, x;
  int d = 0;
  long long y = 1;
  long long s = 0;
  cin >> n;
  n1 = n;
  while (n) {
    n = n / 10;
    d++;
  }
  x = (n1 - pow(10.00000000, d - 1) + 1) * d;
  while (d >= 2) {
    x += (d - 1) * 9 * pow(10.000000000, d - 2);
    d--;
  }
  cout << x;
  return 0;
}
