process.stdin.resume();
process.stdin.setEncoding('utf8');

var g_input = '';
process.stdin.on('data', function(chunk) {
    g_input += chunk;
});

process.stdin.on('end', function() {
    Main(g_input.split(/\r?\n/));
});

function Main(input) {
    var n = parseInt(input[0], 10);
    var l = new Array(n);
    var r = new Array(n);
    for (var i = 0; i < n; i++) {
        var values = input[i + 1].split(' ');
        l[i] = parseInt(values[0], 10);
        r[i] = parseInt(values[1], 10);
    }

    var audience = 0;
    for (var i = 0; i < n; i++) {
        audience += r[i] - l[i] + 1;
    }

    console.log(audience);

    return 0;
}

