let k_p x y z = not (x = y || x = z || y = z) && not (x < y && y < z) && not (x > y && y > z) let () = let a = Array.init 3 (fun _ -> Scanf.scanf "%d " (fun i -> i)) in if a.(0) = a.(1) || a.(0) = a.(2) || a.(1) = a.(2) then print_endline "0" else if k_p a.(0) a.(1) a.(2) then print_endline "INF" else let m = Array.fold_left max 0 a in let rec doit i s = if i > m then s else doit (i + 1) (s + if k_p (a.(0) mod i) (a.(1) mod i) (a.(2) mod i) then 1 else 0) in doit 3 0 |> Printf.printf "%d\n"