(defun main (&rest argv) (declare (ignorable argv)) (let* ((a (read)) (b (read)) (c (read))) (cond ((or (= a b) (= b c) (= c a)) (format t "0~%")) ((or (and (< b a) (< b c)) (and (> b a) (> b c))) (format t "INF~%")) (t (let ((ans 0)) (loop for i from 2 to (max a c) do (let ((p (mod a i)) (q (mod b i)) (r (mod c i))) (when (and (/= p r) (or (and (< q p) (< q r)) (and (> q p) (> q r)))) (incf ans)))) (format t "~d~%" ans)))))) (main)