#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, sum = 0, i, x = 0;
  cin >> n;
  long long int m = n;
  while (m) {
    x++;
    m /= 10;
  }
  long long int s = x * (n + 1);
  long long int l = 1;
  for (i = 1; i < x; i++) {
    l = l * 10 + 1;
  }
  cout << s - l;
}
