#include <bits/stdc++.h>
using namespace std;
long long so;
long long tong;
long long capso;
char s[33], s2[33], tam[2], kq[33];
long long nhan10(int cs) {
  int i;
  capso = 1;
  for (i = 1; i < cs; i++) capso = capso * 10;
  return capso;
}
void solve() {
  int i, j, dai;
  long long cap;
  tong = 0;
  dai = strlen(s);
  so = atol(s);
  if (dai == 1) {
    tong = so;
  } else {
    if (dai > 1) {
      for (i = 1; i <= dai; i++) {
        cap = nhan10(i);
        if (i == 1) {
          so = so - 9;
          tong = tong + 9;
        } else {
          if (i == dai) {
            tong = tong + so * i;
          } else {
            so = so - (9 * cap);
            tong = tong + 9 * cap * i;
          }
        }
      }
    }
  }
}
void output() { printf("%I64d\n", tong); }
int main() {
  int i;
  while (gets(s)) {
    solve();
    output();
  }
  return 0;
}
