#include <bits/stdc++.h>
using namespace std;
inline int pow(int x, int n) {
  if (n < 1) return 1;
  if (n == 1) return x;
  int t = pow(x, n / 2);
  if (n & 1)
    return t * t * x;
  else
    return t * t;
}
int main() {
  int a[11] = {0,      1,       10,       100,       1000,      10000,
               100000, 1000000, 10000000, 100000000, 1000000000};
  int n;
  while (cin >> n) {
    int sz, l = 0, h = 10, m = 5;
    while (h - l) {
      if (a[m] == n)
        l = h = m;
      else if (n > a[m]) {
        l = m + 1;
        if (n < a[l]) l = h = m;
      } else {
        h = m - 1;
        if (n > a[h]) l = h;
      }
      m = (l + h) / 2;
    }
    cout << l * (n + 1ll) - 1111111111 / pow(10, 10 - l) << endl;
  }
}
