solve [] = [] solve str@(x:xs) = solve xs ++ [i|i <- [1..length str], let s = take i str, s == reverse s] main = do str <- getLine print $ maximum $ filter (< length str) (solve str)