#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  int d = str.size();
  long long toadd = 0;
  long long tosubtract = 0;
  for (int i = 0; i < d - 1; i++) {
    tosubtract += 9 * pow(10, i);
    toadd += 9 * pow(10, i) * (i + 1);
  }
  cout << (stoll(str) - tosubtract) * d + toadd;
}
