#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a = 1;
  long long b = 10;
  long long sum = 0;
  while (b <= n) {
    sum += 9 * (b / 10) * a;
    a++;
    b *= 10;
  }
  sum += (n - (b / 10) + 1) * a;
  cout << sum;
}
