#include <bits/stdc++.h>
using namespace std;
string to_string2(uint64_t n) {
  stringstream ss;
  ss << n;
  string t;
  ss >> t;
  return t;
}
uint64_t pow10(int N) {
  uint64_t s = 1;
  if (N == 0) return 1;
  for (int i = 0; i < N; i++) {
    s *= 10;
  }
  return s;
}
uint64_t D(int N) { return N * 9 * pow10(N - 1); }
int main() {
  uint64_t num;
  cin >> num;
  uint64_t sum = 0;
  int length = to_string2(num).length();
  for (int i = length - 1; i >= 0; i--) {
    sum += D(i);
  }
  sum += length * (num - pow10(length - 1) + 1);
  cout << (uint64_t)sum << '\n';
  return 0;
}
