(defun main (&rest argv) (declare (ignorable argv)) (let* ((b (read)) (c (read)) (d (read)) (n (read)) (a (sort (make-array 3 :initial-contents (list b c d)) #'<)) (e (make-array n :element-type 'integer)) (res 0)) (dotimes (i n) (setf (aref e i) (read))) (sort e #'<) (loop for i from (1- n) downto 2 when (>= (aref e i) (aref a 2)) do (loop for j from (1- i) downto 1 when (>= (aref e j) (aref a 1)) do (loop for k from (1- j) downto 0 when (>= (aref e k) (aref a 0)) do (let ((f 1)) (dotimes (l k) (setq f (* f 2))) (incf res f))))) (format t "~d~%" res))) (main)