function Main (input) {
  input = input.split("\n");
  var N = parseInt(input[0], 10);
  input.shift();
  input.pop();
  var ans = 0;
  input = input.map(inp => inp.split(" ").map(Number));
  for (var i of input) {
    ans += i[1] - i[0] + 1;
  }
  console.log(ans);
}

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