#include <bits/stdc++.h>
using namespace std;
long long int a[100088];
int main() {
  long long int a, e, f, b, c, d = 0, s = 0, i = 0, q, j = 10, g = 2, y = 0;
  scanf("%lld", &b);
  a = b;
  while (a != 0) {
    c = a % 10;
    a = a / 10;
    s++;
  }
  int p = s;
  if (s == 1) {
    cout << b << endl;
    return 0;
  }
  while (p != 1) {
    d = d + pow(10, i) * 9;
    i++;
    p--;
  }
  a = b - d;
  q = a * s;
  s--;
  while (s != 1) {
    y = y + 9 * j * g;
    g++;
    j = j * 10;
    s--;
  }
  cout << q + 9 + y << endl;
  return 0;
}
