isEvenString :: String -> Bool
isEvenString s
  | odd $ length s = False
  | takeHalf s ++ takeHalf s == s = True
  | otherwise = False

takeHalf :: String -> String
takeHalf s = take n s
  where n = (length s) `div` 2

solve :: String -> Int
solve s
  | isEvenString s' = length s - 1
  | otherwise = solve $ init s'
    where s' = init s

main  :: IO ()
main = print . solve <$> getLine