main :: IO()
main = do
    getLine
    vls <- map read . words <$> getLine
    cls <- map read . words <$> getLine
    print $ getsolve vls cls

getsolve vls [] = 0
getsolve vls cls
    | head vls > head cls			= ((head vls) - (head cls)) + (getsolve (tail vls) (tail cls))
    | otherwise						=(getsolve (tail vls) (tail cls))