n = gets.to_i
ans = 0

def keta(m)
  ret = 0
  for i in 1..(m-1) do
    if i.even?
      ret += 10 ** i - 10 ** (i-1)
    end
  end
  ret
end

def keta2(m)
  ret = 0
  for i in 1..(m-1) do
    if i.odd?
      ret += 10 ** i - 10 ** (i-1)
    end
  end
  ret
end

for m in 1..6 do
  if n / 10 ** m == 0
    if m.odd?
      if m == 1
        ans = n
      else
        ans = n % 10 ** m - keta(m)
      end
    else
      ans = keta2(m)
    end
    break
  end
end

puts ans