(let* ((n (string->number (read-line))) (v (list->vector(map string->number (string-split (read-line) " "))))) (letrec ((calc-max (lambda (i a1 a2) (cond ((eq? i 3) (max a1 (+ (vector-ref v (- i 1)) a2))) (else (calc-max (- i 1) (max a1 (+ (vector-ref v (- i 1)) a2)) a1)))))) (print (cond ((eq? n 1) (vector-ref v 0)) ((eq? n 2) (max (vector-ref v 0) (vector-ref v 1))) (else (calc-max n (vector-ref v 0) (max (vector-ref v 0) (vector-ref v 1))))))))