defmodule Main do def main do n = IO.gets("") |> String.trim |> String.to_integer strike(1, n, 0) end def strike(biscuit, n, count) when biscuit < n do strike(pocket(biscuit), n, count + 1) end def strike(_biscuit, _n, count) do IO.puts count end def pocket(n) do n * 2 end end