#include <bits/stdc++.h>
using namespace std;
long long length(long long n) {
  long long l = 0;
  while (n) {
    l++;
    n /= 10;
  }
  return l;
}
long long ten_power(int n) {
  long long p = 1;
  int i = 0;
  while (i < n) {
    p *= 10;
    i++;
  }
  return p;
}
long long solve(long long n) {
  if (n < 10) return n;
  int l = length(n);
  long long tp = ten_power(l - 1);
  return solve(tp - 1) + (n + 1 - tp) * l;
}
int main() {
  long long n;
  cin >> n;
  cout << solve(n) << endl;
  return 0;
}
