function Main(input) {
  input = input.split("\n")
  n = Number(input[0]);
  ans = 0;
  for(var i=1; i<=n; i++){
    if(String(i).length%2 == 1){
      ans++;
    }
  }
  console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));