#include <bits/stdc++.h>
using namespace std;
void debug() {}
long long int sumgp(int n) {
  long long int sum = 0, p = 9;
  for (int i = 1; i <= n; ++i) {
    sum += i * p;
    p *= 10;
  }
  return sum;
}
int main() {
  debug();
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int count = 0, x = n;
  string s;
  while (x > 0) {
    count++;
    x /= 10;
    s += '9';
  }
  long long int sum = sumgp(count - 1);
  long long int no = stoll(s);
  no /= 10;
  sum += ((n - no) * count);
  cout << sum << endl;
  return 0;
}
