defmodule Main do def input, do: IO.read(:line) |> String.trim def ii, do: input() |> String.to_integer def li, do: input() |> String.split |> Enum.map(&String.to_integer/1) def yn(b), do: IO.puts(if b, do: "Yes", else: "No") def main do [a, b, c] = li() if is_kadomatu(a, b, c) do IO.puts "INF" else ma = Enum.max([a, b, c]) 1..ma |> Enum.map(fn i -> {rem(a, i), rem(b, i), rem(c, i)} end) |> Enum.count(fn {a, b, c} -> is_kadomatu(a, b, c) end) |> IO.puts end end def is_kadomatu(a, b, c) do if a == b or b == c or c == a do false else mi = Enum.min([a, b, c]) ma = Enum.max([a, b, c]) b == mi or b == ma end end end