isGoo :: String -> Bool
isGoo s
    | length s `mod` 2 /= 0 = False
    | otherwise = let half = length s `div` 2
                      (a, b) = splitAt half s
                  in  a == b

lengthGooR :: String -> Int
lengthGooR [] = 0
lengthGooR (s:ss)
    | isGoo ss = length ss
    | otherwise = lengthGooR ss

main = getLine >>= print . lengthGooR . reverse