#include <bits/stdc++.h>
using namespace std;
long long int power(long long int a, long long int b) {
  long long int ret = 1;
  while (b) {
    if (b % 2) ret *= a;
    b /= 2;
    a = a * a;
  }
  return ret;
}
int main() {
  long long int n, m, x, l, ans = 0;
  cin >> n;
  while (1) {
    if (!n) break;
    m = n;
    l = 0;
    while (m) {
      m /= 10;
      l++;
    }
    x = power(10, l - 1);
    ans += (long long int)l * (n - x + 1);
    n = x - 1;
  }
  cout << ans << '\n';
  return 0;
}
