#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = 10 * x + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int main() {
  int n = read();
  long long ans = 0;
  for (long long i = 1, j = 10; i <= 10; i++, j *= 10) {
    if (n >= j)
      ans += (long long)(j - j / 10) * i;
    else {
      ans += (long long)(n - j / 10 + 1) * i;
      break;
    }
  }
  cout << ans << endl;
  return 0;
}
