import std.stdio, std.string, std.conv, std.bigint, std.typecons, std.algorithm, std.array, std.math, std.range, std.functional;
 
void main() {
    auto N = readln.chomp.to!int;
    N.iota.map!(i => readln.split.to!(ulong[]).pipe!(range => range[1] - range[0] + 1)).sum.writeln;
}