input_number = gets.chomp.to_i
total = 0
1.upto(input_number){|n|
    if (1 <= n and n <= 9)
        total += 1
    elsif(100 <= n and n <= 999)
        total += 1
    elsif(10000 <= n and n <= 99999)
        total += 1
    end
}
puts total