main :: IO ()
main = do
    s <- getLine
    print $ length $ head $ dropWhile f $ init $ iterate init s

f :: String -> Bool
f s | odd (length s) = True
f s = let (xs, ys) = splitAt (length s `div` 2) s
      in  xs /= ys