object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val N = sc.nextInt()
  val V, C = List.fill(N)(sc.nextInt())
  println(V.zip(C).collect { case (v, c) if c < v => v - c }.sum)
}
