(defun main (&rest argv) (declare (ignorable argv)) (let* ((s (read-line)) (n (length s)) (c 0) (w1 0) (w2 0)) (dotimes (i n) (cond ((char= #\c (char s i)) (incf c)) ((char= #\w (char s i)) (incf w2 w1) (incf w1 c)) (t))) (format t "~d~%" w2))) (main)