(define (same-character s l r) (let loop ([c 0] [i l] [j (- r 1)]) (cond [(= i r) c] [(char=? (string-ref s i) (string-ref s j)) (loop (+ c 1) (+ i 1) (- j 1))] [else (loop c (+ i 1) (- j 1))]))) (define (main args) (let* ([s (read-line)] [sl (string-length s)]) (print (let loop ([l 0] [r 1] [mx 0]) (cond [(= l sl) mx] [(= r sl) (loop (+ l 1) r (max mx (same-character s l r)))] [else (loop l (+ r 1) (max mx (same-character s l r)))])))) 0)