import qualified Data.ByteString.Char8 as B

main = B.getLine >>= print . check . B.tail . B.reverse
    where
        check xs
            | odd len = solve (B.tail xs) (len - 1)
            | otherwise = solve xs len
            where
                len = B.length xs


solve :: B.ByteString -> Int -> Int
solve xs len
    | ys == zs = len
    | otherwise = solve (B.drop 2 xs) (len - 2)
    where
        (ys, zs) = B.splitAt (len `div` 2) xs
