"use strict";

const main = arg => {

    const input = arg.trim().split("\n");
    const n = parseInt(input[0]);

    let sum = 0;
    for (let i = 0; i < n; i++) {
        const left = input[i + 1].split(" ")[0].trim();
        const right = input[i + 1].split(" ")[1].trim();
        sum += right - left + 1;
    }
    console.log(sum);
}

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