main = do li <- getLine let n = read li print $ compute n compute 1 = 0 compute n = 1 + compute (div n 2)