#include <bits/stdc++.h>
using namespace std;
int i, j, k, n;
int main() {
  cin >> n;
  long long int ans;
  if (n < 10) {
    ans = n;
  } else if (n < 100) {
    ans = 9 + 2 * (n - 10 + 1);
  } else if (n < 1000) {
    ans = 9 + 2 * 90 + 3 * (n - 100LL + 1);
  } else if (n < 10000) {
    ans = 9 + 2 * 90 + 3 * 900 + 4 * (n - 1000LL + 1);
  } else if (n < 100000) {
    ans = 9 + 2 * 90 + 3 * 900 + 4 * 9000 + 5 * (n - 10000LL + 1);
  } else if (n < 1000000) {
    ans =
        9 + 2 * 90 + 3 * 900 + 4 * 9000 + 5 * 90000LL + 6 * (n - 100000LL + 1);
  } else if (n < 10000000) {
    ans = 9 + 2 * 90 + 3 * 900LL + 4 * 9000LL + 5 * 90000LL + 6 * 900000LL +
          7 * (n - 1000000LL + 1);
  } else if (n < 100000000) {
    ans = 9 + 2 * 90LL + 3 * 900LL + 4 * 9000LL + 5 * 90000LL + 6 * 900000LL +
          7 * 9000000LL + 8 * (n - 10000000LL + 1);
  } else if (n < 1000000000) {
    ans = 9 + 2 * 90LL + 3 * 900LL + 4 * 9000LL + 5 * 90000LL + 6 * 900000LL +
          7 * 9000000LL + 8 * 90000000LL + 9 * (n - 100000000LL + 1);
  } else {
    ans = 9 + 2 * 90LL + 3 * 900LL + 4 * 9000LL + 5 * 90000LL + 6 * 900000LL +
          7 * 9000000LL + 8 * 90000000LL + 9 * 900000000LL +
          10 * (n - 1000000000LL + 1LL);
  }
  cout << ans << endl;
  return 0;
}
