import Control.Applicative

f [] _ = 0
f (x:xs) (y:ys) = if x > y then x - y + f xs ys else f xs ys

main = do
    n <- fmap (read :: String -> Int) . words <$> getLine
    v <- fmap (read :: String -> Int) . words <$> getLine
    c <- fmap (read :: String -> Int) . words <$> getLine
    print $ f v c

