#include <bits/stdc++.h>
long long All[1];
long long mypow(int base, int power) {
  long long i = 1;
  for (int k = 0; k < power; k++) i *= base;
  return i;
}
int main() {
  All[1] = 9;
  char asc[25];
  int l;
  for (long long i = 2; i <= 9; i++) {
    All[i] = All[i - 1] + i * 9 * mypow(10, i - 1);
  }
  scanf("%s", asc);
  l = strlen(asc);
  if (l == 1) {
    printf("%s\n", asc);
    return 0;
  } else {
    long long res;
    res = (long long)atoi(asc);
    res = res - mypow(10, l - 1) + 1;
    res = res * l;
    res = res + All[l - 1];
    printf("%I64d\n", res);
    return 0;
  }
}
