"use strict";
function I(t, i) {
  (this._s = t.split("\n")), (this._c = 0), (this._l = 0), (this._f = i || Number);
}
(I.prototype.a = function(t) {
  var i = this._s[this._l];
  if (i) {
    var s = i.trim().split(" "),
      h = s[this._c];
    return this._c++, s.length === this._c && ((this._c = 0), this._l++), t ? t(h) : this._f(h);
  }
}),
  (I.prototype.l = function(t) {
    var i = this._s[this._l];
    if (i) return (this._c = 0), this._l++, i.split(" ").map(t || this._f);
  }),
  (module.exports = I);

function isOddDigit(num) {
  if (num < 10) return true; // 1
  if (num < 100) return false; // 2
  if (num < 1000) return true; // 3
  if (num < 10000) return false; // 4
  if (num < 100000) return true; // 5
  if (num < 1000000) return false; // 6
}

function main(input) {
  var o = new I(input);

  const N = o.a();

  let oddDigitCount = 0;
  for (let i = 1; i <= N; i++) {
    if (isOddDigit(i)) {
      oddDigitCount++;
    }
  }

  console.log(oddDigitCount);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
