open Printf open Scanf
open Array

let () = scanf " %d" @@ fun n ->
  init n (fun _ -> scanf " %d" @@ fun v -> v)
  |> map (fun v -> scanf " %d" @@ fun c -> max (v-c) 0)
  |> fold_left (+) 0
  |> print_int
