import Data.List(permutations, tails)

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 = concat $ map tails $ permutations vcs
    print $ maximum $ map sum comb