import scala.io.StdIn._

object Main extends App {

  val n = readInt()
  val v = readLine().split(" ").map(_.toInt)
  val c = readLine().split(" ").map(_.toInt)

  def solve() = {
    (0 until n).foldLeft(0) { (acc, i) =>
      if(v(i)-c(i) > 1) acc + (v(i)-c(i)) else acc
    }
  }

  println(solve())

}

