main = do
    n <- getLine
    vs <- (map read) <$> words <$> getLine :: IO [Int]
    cs <- (map read) <$> words <$> getLine :: IO [Int]
    let vcs = zipWith (-) vs cs
    let comb = combs vcs
    print $ maximum $ map sum comb

combs :: [a] -> [[a]]
combs [] = [[]]
combs (x:xs) = [x:rs | rs<-combs xs] ++ (combs xs)