// JavaScript source code
"use strict";

let myFunc = (input) => {
    input = input.split("\n")
    let N = parseInt(input[0]);
    let ans = 0;
    for(let i = 1; i <= N; i++){
        let lr;
        lr = input[i].split(" ");
        let l, r;
        l = parseInt(lr[0]);
        r = parseInt(lr[1]);
        ans += (r - l + 1);
    }
    console.log(ans);
};

myFunc(require("fs").readFileSync("/dev/stdin", "utf8"));