#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long on[] = {1,      10,      100,      1000,      10000,
                    100000, 1000000, 10000000, 100000000, 1000000000};
  long long n;
  cin >> n;
  long long ans = 0;
  int l = log10(n);
  for (int i = 1; i <= l; i++) {
    ans += (on[i] - on[i - 1]) * i;
  }
  n -= on[l];
  ans += (n + 1) * (l + 1);
  cout << ans;
}
