
main :: IO ()
main = do
    str <- getLine
    print $ solve $ reverse str

solve :: String -> Int
solve "" = 0
solve (c:ss) | isOk ss = length ss
             | otherwise = solve ss
    where
        isOk s = let n = length s
                     (a,b) = splitAt (n`div`2) s
                  in even n && a == b