Scanf.scanf "%d" (fun n -> let rec loop r i = if r = 0 then i else loop (r / 2) (i + 1) in loop (n - 1) 0 |> Printf.printf "%d\n" )