input = gets.split.map(&:to_i).first
count = 0
1.step(6, 2) do |n|
  # puts 10**n
  if input >= (10 ** n)
    count += (10 ** n) - (10 ** (n - 1))
  elsif input >= (10 ** (n - 1))
    count += input - (10 ** (n - 1)) + 1
    break
  end
end

puts count
