type ABC(stream:System.IO.TextReader) =
  member this.Scan1 f = stream.ReadLine() |> f
  member this.ScanVecH f = stream.ReadLine().Split() |> Array.map f

let util = ABC(stdin)

util.Scan1 id |> ignore
let vs = util.ScanVecH int
let cs = util.ScanVecH int

Array.map2 (-) vs cs
|> Array.filter ((<) 0)
|> Array.append [|0|]
|> Array.sum
|> printfn "%d"
