import Data.List

main = do
    s <- getLine
    print $ solve (next s)

next s = take n s
    where n = length s - 2

isss s = s1 == s2
    where (s1, s2) = splitAt (length s `div` 2) s

solve [] = -1
solve s | isss s = length s
        | otherwise = solve (next s)
    where n = length s