#include <bits/stdc++.h>
using namespace std;
long long int pow1(long long int a, long long int b) {
  if (b == 0) return 1LL;
  if (b == 1) return a;
  if (b % 2 == 1) return a * pow1(a * a, b / 2);
  return pow1(a * a, b / 2);
}
int arr[9];
int main() {
  int i, k = 1;
  for (i = 0; i < 9; i++) {
    arr[i] = 9 * k;
    k *= 10;
  }
  int n, nk;
  scanf("%d", &n);
  nk = n;
  int len = 0;
  while (nk != 0) {
    len++;
    nk /= 10;
  }
  long long int s = n, ans = 0LL;
  s -= pow1(10, len - 1);
  ans += (s + 1) * (long long)len;
  len--;
  while (len >= 1) {
    ans += (long long)len * arr[len - 1];
    len--;
  }
  cout << ans << endl;
  return 0;
}
