#include <bits/stdc++.h>
using namespace std;
long long expo(long long a, long long b) {
  long long result = 1;
  while (b) {
    if (b & 1) result = (result * a);
    b >>= 1;
    a = (a * a);
  }
  return result;
}
int main() {
  long long n;
  cin >> n;
  long long num = 0, p = n, l = 1;
  while (p) {
    num++;
    p /= 10;
  }
  long long ans = num * ((n - expo(10, num - 1)) + 1);
  num--;
  while (num > 0) {
    ans += (9 * expo(10, num - 1)) * num;
    num--;
  }
  cout << ans << endl;
}
