#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  long long res = 0;
  long long p10[11];
  p10[0] = 1;
  for (int i = 1; i < 11; i++) {
    p10[i] = p10[i - 1] * 10ll;
  }
  cin >> n;
  for (int i = 1; i < log10(n + 1); i++) {
    res += i * (p10[i] - p10[i - 1]);
  }
  res += (long long)((int)log10(n) + 1) * (n - p10[(int)log10(n)] + 1);
  cout << res;
  return 0;
}
