#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long gcd(long long a, long long b) { return (b == 0) ? a : gcd(b, a % b); }
long long num(long long a) {
  long long arr[] = {0,      9,       99,       999,       9999,      99999,
                     999999, 9999999, 99999999, 999999999, 9999999999};
  return arr[a];
}
int main() {
  long long n;
  cin >> n;
  if (n <= 9) {
    cout << n << endl;
    return 0;
  }
  long long x = n;
  long long count = 0;
  while (n > 0) {
    count++;
    n = n / 10;
  }
  long long ans = 0;
  long long b = count - 1;
  while (b > 0) {
    ans += (num(b) - num(b - 1)) * b;
    b--;
  }
  ans += (x - num(count - 1)) * count;
  cout << ans << endl;
  return 0;
}
