# ABC073B - Theater

n = int(eval(input()))

lst = [list(map(int, input().rstrip().split())) for _ in range(n)]

total = 0

for i in lst:

    total += i[1] - i[0] + 1

print(total)
# ABC073B - Theater

def main():

    N, *LR = list(map(int, open(0).read().split()))

    ans = sum(r - l + 1 for l, r in zip(*[iter(LR)] * 2))

    print(ans)





if __name__ == "__main__":

    main()
# ABC073B - Theater
n = int(eval(input()))
lst = [list(map(int, input().rstrip().split())) for _ in range(n)]
total = 0
for i in lst:
    total += i[1] - i[0] + 1
print(total)

# ABC073B - Theater
def main():
    N, *LR = list(map(int, open(0).read().split()))
    ans = sum(r - l + 1 for l, r in zip(*[iter(LR)] * 2))
    print(ans)


if __name__ == "__main__":
    main()

-n = int(eval(input())) -lst = [list(map(int, input().rstrip().split())) for _ in range(n)] -total = 0 -for i in lst: -    total += i[1] - i[0] + 1 -print(total) +def main(): +    N, *LR = list(map(int, open(0).read().split())) +    ans = sum(r - l + 1 for l, r in zip(*[iter(LR)] * 2)) +    print(ans) + + +if __name__ == "__main__": +    main()