#include <bits/stdc++.h>
using namespace std;
long long int dig(long long int n) {
  long long int ans = 0, x;
  while (n > 0) {
    x = n % 10;
    ans++;
    n /= 10;
  }
  return ans;
}
int main() {
  long long int n, ans = 0, d, x, p;
  cin >> n;
  d = dig(n);
  x = n - (pow(10, d - 1) - 1);
  p = d - 1;
  while (p > 0) {
    ans = ans + ((9 * pow(10, p - 1)) * p);
    p--;
  }
  ans = ans + x * d;
  cout << ans << endl;
}
