#include <bits/stdc++.h>
using namespace std;
map<char, int> h;
int main() {
  long long int n, k, l, ans;
  cin >> n;
  k = n;
  int count = 0;
  while (n > 0) {
    n = n / 10;
    count++;
  }
  long long int p = pow(10, count - 1);
  ans = (k - p + 1) * count;
  count = count - 1;
  while (count > 0) {
    l = pow(10, count - 1);
    ans = ans + (count * 9 * l);
    count--;
  }
  cout << ans;
}
