(loop with cnt = 0 for i from 1 to (parse-integer (read-line)) do (let ((words (mapcar #'string-downcase (list (read) (read) (read) (read))))) (when (and (position "akai" words :test #'equal) (position "marui" words :test #'equal) (position "okii" words :test #'equal) (position "umai" words :test #'equal)) (incf cnt))) finally (format t "~a~%" cnt))