import Control.Arrow
import Data.List

main :: IO ()
main = print . solve =<< getLine

solve :: String -> Int
solve s = iter len $ reverse $ take len $ tail $ splits s
  where
    len = length s `div` 2 - 1
    iter _ []               = 0
    iter m ((xs, ys) : rs)  = if xs `isPrefixOf` ys then 2*m else iter (m - 1) rs

splits :: [a] -> [([a], [a])]
splits [] = [([], [])]
splits xxs@(x:xs) = ([], xxs) : map (first (x:)) (splits xs)
