#include <bits/stdc++.h>
using namespace std;
string int_to_string(int a) {
  stringstream ss;
  ss << a;
  return ss.str();
}
string double_to_string(double a) {
  stringstream ss;
  ss << a;
  return ss.str();
}
string float_to_string(float a) {
  stringstream ss;
  ss << a;
  return ss.str();
}
string long_to_string(long a) {
  stringstream ss;
  ss << a;
  return ss.str();
}
string long_long_to_string(long long a) {
  stringstream ss;
  ss << a;
  return ss.str();
}
int string_to_int(string s) { return atoi(s.c_str()); }
float string_to_float(string s) { return atof(s.c_str()); }
long string_to_long(string s) { return atol(s.c_str()); }
long long string_to_long_long(string s) { return atoll(s.c_str()); }
int main() {
  long long n, c = 0;
  cin >> n;
  for (long long i = 1; i <= n; i *= 10) c += (n - (i - 1));
  cout << c;
  return 0;
}
