main = do
  s <- getLine
  print $ solve $ init s

ev :: String -> Bool
ev str = even n && l == r
  where n = length str
        m = n `div` 2
        (l,r) = splitAt m str

solve :: String -> Int
solve [] = 0
solve str = max res (solve st)
  where res = if ev str then length str else 0
        st = init str