solve :: String -> Int
solve [] = 0
solve ss@(_:xs)
    | odd l = solve xs
    | otherwise = let (a, b) = splitAt (l `div` 2) ss
                  in if a == b then l else solve xs
    where
        l = length ss

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