#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, ans, c, ca = 9, i = 1;
  ans = 0;
  cin >> n;
  c = 9;
  while (c <= n) {
    ans += ca * i++;
    c = c * 10 + 9;
    ca *= 10;
  }
  c = (c - 9) / 10;
  ans += (n - c) * i;
  cout << ans;
}
int main() {
  solve();
  return 0;
}
