#include <bits/stdc++.h>
using namespace std;
long long mini(long long int a, long long int b) {
  if (a <= b) {
    return a;
  } else
    return b;
}
int main() {
  long long int n, ans;
  cin >> n;
  ans = mini(n, 9);
  if (n >= 10) ans += (mini(n, 99) - 9) * 2;
  if (n >= 100) ans += (mini(n, 999) - 99) * 3;
  if (n >= 1000) ans += (mini(n, 9999) - 999) * 4;
  if (n >= 10000) ans += (mini(n, 99999) - 9999) * 5;
  if (n >= 100000) ans += (mini(n, 999999) - 99999) * 6;
  if (n >= 1000000) ans += (mini(n, 9999999) - 999999) * 7;
  if (n >= 10000000) ans += (mini(n, 99999999) - 9999999) * 8;
  if (n >= 100000000) ans += (mini(n, 999999999) - 99999999) * 9;
  if (n >= 1000000000) ans += (mini(n, 9999999999) - 999999999) * 10;
  cout << ans << endl;
}
