{-# LANGUAGE ScopedTypeVariables #-}
import Control.Applicative
import Control.Monad
import Data.List
import Text.Printf

solve [] [] ans = ans
solve (v:vs) (c:cs) ans
    | v > c = solve vs cs (ans + v -c)
    |otherwise = solve vs cs ans

main = do
    _ <- getLine
    v <- map read . words <$> getLine
    c <- map read . words <$> getLine
    let answer = solve v c 0
    print answer

