#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const double EXP = 2.7182818284590452;
const double Pi = 3.14159265;
const double EPS = 1e-13;
const int INF = 1000 * 1000 * 1000;
const long long INFL = (long long)INF * (long long)INF;
long long n;
long long res;
void accept() {
  cin >> n;
  for (long long i = 1, j = 1; i <= INF; i *= 10, ++j) {
    res += ((0 < (((n - i + 1) < 9L * i) ? ((n - i + 1)) : (9L * i)))
                ? ((((n - i + 1) < 9L * i) ? ((n - i + 1)) : (9L * i)))
                : (0)) *
           j;
  }
  cout << res;
}
int main(void) {
  accept();
  return 0;
}
