is_even s = iter x y
  where iter [] [] = True
        iter (x1:xs) (y1:ys)
          | x1 == y1 = iter xs ys
          | otherwise = False
        x = take len s
        y = drop len s
        len = div (length s) 2

solve s = iter $ reverse s
  where iter [] = 0
        iter (x1:x2:xs)
          | is_even(xs) = length xs
          | otherwise = iter xs

main = do
  s <- getLine
  print $ solve s
