main :: IO () main = readLn >>= print . (\n -> if n == 1 then 0 else floor (logBase 2 (n - 1)) + 1)