function Main(input) {
	input = input.split("\n");
	var n = input[0];
	var a = 0;
	for(i = 1; i <= n; i++){
		l = input[i].split(" ");
		a += l[1] - l[0] + 1;
	}
	console.log(a);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));