main :: IO () main = do -- Read an integer from standard input n <- readLn :: IO Int -- Apply the ternary logic and logarithmic calculation let result = if n == 1 then 0 else floor (logBase 2 (fromIntegral (n - 1) :: Double)) + 1 print result