let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}
var a=arr[0]

var i = 0
var o = 0
while a != 0 {
	var s = String(a) 
  	a -= 1
  	if( ( s.characters.count % 2 ) == 1 ) {
      o += 1
    }
}

print( o )