isEvenString :: String -> Int -> Bool
isEvenString s n
  | even n && half ++ half == s = True
  | otherwise = False
  where half = takeHalf s n
 
takeHalf :: String -> Int -> String
takeHalf s n = take (div n 2) s
 
solve :: String -> Int -> Int
solve (x:xs) n
  | isEvenString xs n' = n'
  | otherwise = solve xs n'
  where n' = n - 1
 
main  :: IO ()
main = do
  s <- getLine
  print $ solve (reverse s) (length s)