(defun main (&rest argv) (declare (ignorable argv)) (let* ((n (read)) (s (make-hash-table)) (i 1)) (loop while (<= (* i i) n) do (when (zerop (mod n i)) (let* ((j (floor n i)) (p (parse-integer (concatenate 'string (write-to-string i) (write-to-string j)))) (q (parse-integer (concatenate 'string (write-to-string j) (write-to-string i))))) (setf (gethash p s) t (gethash q s) t))) (incf i)) (format t "~d~%" (hash-table-count s)))) (main)