#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  long long n;
  long long ans = 0;
  cin >> n;
  long long aux = n, sum = 0, p = 1, d;
  while (aux) {
    d = aux % 10, aux /= 10;
    ans += ((n % p) + 1);
    ans += p * d;
    ans += sum * d * 10;
    ans -= p, sum = p + 10 * sum, p *= 10;
  }
  cout << ans << endl;
  return 0;
}
