import Data.Traversable
import Data.List

main = do
  n <- getLine
  vs <- map read . words <$> getLine
  cs <- map read . words <$> getLine
  putStrLn . show $ solve $ zip vs cs

solve :: [(Int, Int)] -> Int
solve [] = 0
solve ((v,c):xs)
  | v - c < 0 = solve xs
  | otherwise = (v-c) + solve xs
