#include <bits/stdc++.h>
using namespace std;
long long po(long long x, int y) {
  int ret = 1;
  for (int i = 0; i < y; ++i) {
    ret *= x;
  }
  return ret;
}
int main() {
  int n, nn, c = 0;
  long long res = 0, nins = 9;
  cin >> n;
  nn = n;
  while (nn) {
    c++, nn /= 10;
    if (nn) res += nins * c, nins *= 10;
  }
  if (c == 1)
    cout << n;
  else {
    res += (n - po(10LL, c - 1) + 1LL) * c;
    cout << res;
  }
}
