import Control.Monad (forM_)

solve [_] _ maxans = maxans
solve ((_,a10):(a01,a11):as) ans maxans = solve ((a01,a11):as) newans $ max maxans newans
  where newans = ans+a01-a10


main :: IO ()
main = do
  n <- read <$> getLine :: IO Int
  a1s <- map read.words <$> getLine :: IO [Int]
  a2s <- map read.words <$> getLine :: IO [Int]
  let as = zip a1s a2s
      firstAns = (head a1s+sum a2s)
  print $ solve as firstAns firstAns
