#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T m) {
  T ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % m;
    p = (p * p) % m;
  }
  return (T)ret;
}
void solve() {
  long long n;
  cin >> n;
  int digit = 1;
  long long res = 0;
  while (true) {
    string from, to;
    for (int i = 1; i <= digit; i++) {
      if (i == 1) {
        from.push_back('1');
      } else {
        from.push_back('0');
      }
    }
    to = from;
    to.push_back('0');
    long long fromint = stoll(from);
    long long toint = stoll(to);
    toint--;
    if (n > toint) {
      res += (toint - fromint + 1ll) * digit;
    } else {
      res += (n - fromint + 1ll) * digit;
      break;
    }
    digit++;
  }
  cout << res << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cout.setf(ios::fixed);
  cout.precision(10);
  cout.tie(nullptr);
  cin.tie(nullptr);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
