"use strict";
const Main = (input) =>{
   let xs = input.trim().split('\n');
   let xs1 = xs[0].trim().split(' ').map(v=>parseInt(v,10));
   let N = Number(xs1);
   let ans = 0;
   for(let i= 1; i<= N; i++){
    var l = xs[i].split(" ")[0];
    var r = xs[i].split(" ")[1];
    ans += (r - l) + 1;
  }
  console.log(ans);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));