fun main(args: Array<String>) {
    val n = readLine()
    val valueList = readLine()!!.split(" ").map { Integer.parseInt(it) }
    val costList = readLine()!!.split(" ").map { Integer.parseInt(it) }
    val maxValueDelta = 0
    var gain = 0
    valueList.forEachIndexed { index, value ->
        if (value > costList[index]){
            gain += value - costList[index]
        }
    }
    println(gain)
}