object Main extends App {
	val N = scala.io.StdIn.readInt
	var sum = 0
	for(i<-0 until N){
		val temp = scala.io.StdIn.readLine.split(" ").map(_.toInt)
		sum = sum + temp(1) - temp(0) + 1
	}

	println(sum)
}
