main :: IO ()
main = interact $ show . solve . reverse
 
solve :: String -> Int
solve s
    | even $ length s = solver s
    | otherwise = solver s'
        where _:s' = s
 
solver :: String -> Int
solver s = if p == q then len else solver s'
    where
        len = length s
        (p, q) = splitAt (len `div` 2) s
        _:_:s' = s