#!/usr/bin/env ruby
# require 'pry'

# N
# a_1 b_1
# ...
# a_N b_N
# ↑を[[a_1,..a_N],[b_1,..b_N]]にする
# N = gets.to_i
# a, b = N.times.map{gets.split.map(&:to_i)}.transpose

n = gets.to_i
ary = [*(1..n)]
count = 0
ary.map do |e|
  count+=1 if e.to_s.length.odd?
end

puts count
