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