#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
long long n;
long long cal(long long x) {
  string s = to_string(x);
  return s.length();
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  if (n < 10) {
    cout << n << endl;
    return 0;
  } else if (n < 100) {
    cout << 2 * (n + 1) - 11 << endl;
    return 0;
  } else if (n < 1000) {
    cout << 3 * (n + 1) - 111 << endl;
  } else {
    long long size = cal(n);
    long long cc = size * n + size - 1, c = 1;
    for (int i = 0; i < size - 1; i++) {
      c *= 10;
      cc -= c;
    }
    cout << cc << endl;
  }
  return 0;
}
