solve :: String -> Int
solve str = foldr1 (+) $ map read $ words str

main :: IO ()
main = do
	l1 <- getLine :: IO String
	l2 <- getLine :: IO String
	let a1 = solve l1
	let a2 = solve l2
	putStrLn $ show (max a1 a2) 