'use strict'

const main = input => {
	const args = input.trim().split('\n')
	const n = parseInt(args[0], 10)
	let cnt = 0

	for (let i = 0; i < n; i++) {
		const t1 = args[i + 1].split(' ').map(Number)
		cnt += t1[1] - t1[0] + 1
	}

	console.log(cnt)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
