import std.algorithm, std.conv, std.range, std.stdio, std.string;

void main()
{
  auto n = readln.chomp.to!size_t;

  auto ans = 0;
  foreach (_; 0..n) {
    auto rd = readln.split.to!(int[]), l = rd[0], r = rd[1];
    ans += r - l + 1;
  }

  writeln(ans);
}
