#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n;
  m = n;
  long long int s = 0;
  long long int x = 10;
  long long int y = 9;
  long long int i = 1;
  long long int flag = 0;
  while (n >= x) {
    s += i * (x - x / 10);
    x = x * 10;
    i++;
    flag = 1;
  }
  if (n != x / 10) {
    if (flag == 0)
      s += i * m;
    else
      m = m - x / 10, s += (m + 1) * i;
  } else
    s += i;
  cout << s << endl;
  return 0;
}
