'use strict';
const main = n => {
  n = parseInt(n[0], 10);
  let ans = 0;
  for(let i=1; i<n+1; i++) if (i.toString().length%2) ans++;
  console.log(ans);
};
main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n'));