(defun main (&rest argv) (declare (ignorable argv)) (let* ((s (read-line)) (n (length s))) (format t "~d~%" (if (and (>= n 2) (char= #\1 (char s 0)) (not (find #\3 s :test (complement #'char=) :start 1))) (1- n) -1)))) (main)