Problem:
 Score : 200 points    Problem Statement Joisino is working as a receptionist at a theater.  The theater has 100000 seats, numbered from 1 to 100000 .  According to her memo, N groups of audiences have come so far, and the i -th group occupies the consecutive seats from Seat l_i to Seat r_i (inclusive).  How many people are sitting at the theater now?      Constraints  1≤N≤1000  1≤l_i≤r_i≤100000  No seat is occupied by more than one person.  All input values are integers.         Input Input is given from Standard Input in the following format:  N  l_1  r_1  :  l_N  r_N       Output Print the number of people sitting at the theater.        Sample Input 1 1
24 30      Sample Output 1 7  There are 7 people, sitting at Seat 24,25,26,27,28,29 and 30 .       Sample Input 2 2
6 8
3 3      Sample Output 2 4

Solution (Python):
N = int(input())
seat = 0
for i in range(N):
    l,r = map(int,input().split())
    seat += r-l+1

print(seat)

Solution (Python):
n=int(input())
sum=0
for s in range(n):
    a,b =map(int,input().split())
    sum += b-a+1
print(sum)

Solution (Python):


N = int(input())
lr = [list(map(int, input().split())) for i in range(N)]

ans = 0
for l, r in lr:
    ans += r - l + 1

print(ans)

Solution (Python):
n = int(input())
l=[]
total=0
for i in range(n):
  l,r=map(int,input().split())
  total += (r-l+1)
print(total)

Solution (Python):
N = int(input())
ans = 0
for _ in range(N):
    l, r = map(int, input().split())
    ans += r - l + 1
print(ans)

Solution (Python):
N = int(input())
cnt = 0
for _ in range(N):
    l, r = map(int, input().split())
    cnt += (r-l)+1
print(cnt)

Solution (Python):
groups = int(input())
total = 0

for _ in range(groups):
  (l, r) = (int(tok) for tok in input().split())
  total += r - l + 1
  
print(total)

Solution (Python):
A = int(input())
ans = 0
for i in range(A):
    x,y =map(int,input().split())
    ans += y-x+1
print(ans)

Solution (Python):
N = int(input())
res = 0
for _ in range(N):
    l, r = map(int, input().split())
    res += r - l + 1
print(res)

Solution (Python):
c=0
for i in range(int(input())):
    l,r=map(int,input().split())
    c+=r-l+1
print(c)

Solution (Python):
N=int(input())
s=0
for i in range(N):
    l,r=map(int,input().split())
    s+=r-l+1
print(s)

Solution (Python):
N=int(input())
List=[]
for i in range(N):
    List.append(list(map(int,input().split())))

Gokei=0
for j in range(N):
    Gokei+=List[j][1]-List[j][0]+1

print(Gokei)

Solution (Python):
n=int(input())
l=[]
total=0
for _ in range(n):
  l,r=map(int,input().split())
  total += (r-l+1)
print(total)

Solution (Python):
n=int(input())
ans=0

for i in range(n):
  l,r = map(int,input().split())
  ans += r - l + 1
print(ans)

Solution (Python):
N = int(input())

count = 0

for i in range(N):
    l, r = map(int, input().split())
    count = count + (r-l) + 1

print(count)

Solution (Python):
n=int(input())
c=0
for i in range(n):
    l,r=input().split()
    c+=(int(r)-int(l)+1)

print(c)

Solution (Python):
N=int(input())
ans=0
for _ in range(N):
    a,b=map(int, input().split())
    ans+=b-a+1
print(ans)

Solution (Python):



N = int(input())
lr = [list(map(int, input().split())) for i in range(N)]


ans = 0
for i in range(N):
    ans += lr[i][1] - lr[i][0] + 1


print(ans)

Solution (Python):
N = int(input())
count = 0
for _ in range(N):
    l,r = map(int,input().split())
    count += r-l+1
print(count)

Solution (Python):
a = int(input())
count = 0
for _ in range(a):
  l, r = map(int, input().split())
  count += 1 + r - l
print(count)

Solution (Python):


N = int(input())


total = 0
for _ in range(N):
    l, r = map(int, input().split())
    total += (r - l + 1)


print(total)

Solution (Python):
N = int(input())
count = 0
while N > 0:
    l,r = map(int, input().split())
    count += r-l+1
    N -= 1
print(count)

Solution (Python):
n = int(input())
ans = 0
for _ in range(n) :
    l, r = map(int, input().split())
    ans += r - l + 1

print(ans)

Solution (Python):
n=int(input())
x=0
for i in range(n):
    l,r=map(int,input().split())
    x+=r-l+1
print(x)

Solution (Python):
n = int(input())
ans = 0
for i in range(n):
    r,l = map(int,input().split())
    ans = ans + l -r + 1
print(ans)

Solution (Python):
n = int(input())
ans = 0

for _ in range(n):
    l, r = map(int, input().split())
    if l == r:
        ans += 1
    else:
        ans += r - l + 1

print(ans)

Solution (Python):
n = int(input())
count = 0

for _ in range(n):
  l, r = map(int, input().split())
  count += r-l+1

print(count)

Solution (Python):
ans = 0
for i in range(int(input())):
    l,r = map(int, input().split())
    ans += ((r-l)+1)
print(ans)

Solution (Python):
n=int(input())
count=0

for _ in range(n):
    l,r=map(int, input().split())
    count+=r-l+1
print(count)

Solution (Python):
n=int(input())
lr=[list(map(int,input().split())) for _ in range(n)]
s=0
for i in range(n):
    s=s+lr[i][1]-lr[i][0]+1
print(s)

Solution (Python):
n = int(input())
count = 0
for i in range(n):
    a, b = map(int, input().split())
    count += b-a+1

print(count)

Solution (Python):
N=int(input())
LIST=[input() for _ in range(N)]

count=0
for i in range(N):
    A,B=map(int,LIST[i-1].split(" "))
    count+=abs(A-B)+1
print(count)

Solution (Python):
def resolve():
    count=0
    for i in range(int(input())):
        l,r=map(int,input().split())
        count+=r-l+1
    print(count)
resolve()

Solution (Python):
n = int(input())
p = 0
for i in range(n):
  x = list(map(int,input().split()))
  p += x[-1]-x[0]+1
print(p)

Solution (Python):
N = int(input())
box = [list(map(int, input().split())) for i in range(N)]
p = 0
for i in range(N):
  p += box[i][1] - box[i][0] + 1
print(p)

Solution (Python):
N = int(input())
p = 0
for i in range(N):
  a,b = map(int, input().split())
  p += b - a + 1
print(p)

Solution (Python):
n = int(input())
count = 0
for i in range(n):
    li,ri = map(int,input().split())
    count += ri-li+1
print(count)

Solution (Python):
n=int(input())
ans=0
for i in range (0,n):
    s=input().split()
    ans+=int(s[1])-int(s[0])+1
print(ans)

Solution (Python):
n = int(input())
a = [0] * 100001
for i in range(n):
    l, r = map(int, input().split())
    for j in range(l, r + 1):
        a[j] = 1
ans = 0
for i in range(100001):
    if (a[i]):
        ans += 1
print(ans)

Solution (Python):
n = int(input())

ans = 0
for i in range(n):
    a, b = map(int, input().split())
    ans += b - a + 1
print(ans)

Solution (Python):
n = int(input())
result = 0
for _ in range(n):
    a,b = map(int,input().split())
    result += b - a + 1
print(result)

Solution (Python):
n = int(input())

list = []
for i in range(n):
  a,b = map(int,input().split())
  c = b-a+1
  list.append(c)
  
print(sum(list))

Solution (Python):
sum=0
for _ in range(int(input())):
  a,b=map(int,input().split())
  sum+=b-a+1
print(sum)

Solution (Python):
n=int(input())

sum=0
for _ in range(n):
  a,b=map(int,input().split())
  sum+=b-a+1
print(sum)

Solution (Python):
print(sum(1-eval(input().replace(" ","-")) for _ in range(int(input()))))

Solution (Python):
n=[list(map(int,input().split())) for _ in range(int(input()))]
ans=0
for x,y in n:
  ans+=(y-x)+1
print(ans)

Solution (Python):
n=int(input())
cnt=0
for i in range(n):
  a,b=map(int, input().split())
  cnt+=(b-a+1)
print(cnt)

Solution (Python):
n = int(input())
cnt = 0
for i in range(n):
	l, r = map(int, input().split(" "))
	cnt += (r - l + 1)
print(cnt)

Solution (Python):

n = int(input())
max_seat = 100000
cnt = 0
for _ in range(n):
    l, r = map(int, input().split())
    cnt += (r-l+1)

print(cnt)

Solution (Python):
N =int(input())


ans = 0
for i in range(N):
  l,t = list(map(int,input().split(' ')))
  ans += t-l+1
  

print(ans)

Solution (Python):
n = int(input())
lr = [[int(i) for i in input().split()] for j in range(n)]
ans = 0
for i in range(n):
    ans += lr[i][1] - lr[i][0]+1
print(ans)

Solution (Python):
N = int(input())
LR = [list(map(int, input().split())) for _ in range(N)]

print(sum( [ lr[1] - lr[0] + 1 for lr in LR]))

Solution (Python):
N = int(input())
cnt=0
for _ in range(N):
  l,r = map(int,input().split())
  cnt+=(1+(r-l))
print(cnt)

Solution (Python):
n=int(input())
ans=0
for _ in range(n):
    l,r=map(int,input().split())
    ans+=r-l+1
print(ans)

Solution (Python):
n = int(input())
ans = 0
for _ in range(n):
    l, r = map(int, input().split())
    ans += r-l+1
print(ans)

Solution (Python):
n = int(input())
c = 0
for i in range(n):
    l, r = map(int, input().split())
    c += r - l + 1
print(c)

Solution (Python):
N=int(input())
X=0
for i in range(N):
  l,n=map(int,input().split())
  X+=n-l+1
print(X)

Solution (Python):
n=int(input())
A=[]
B=[]
for i in range(n):
    a,b =map(int,input().split())
    A.append(b-a+1)
print(sum(A))

Solution (Python):
n = int(input())
l = [list(map(int, input().split())) for _ in range(n)]
print(sum(i[1] - i[0] + 1 for i in l))

Solution (Python):
n = int(input())
l = [list(map(int, input().split())) for _ in range(n)]

ans = 0
for i in range(n):
    ans += l[i][1] - l[i][0] + 1
print(ans)

Solution (Python):
n = int(input())
lr = [list(map(int, input().split())) for _ in range(n)]
print(sum([i[1] -i[0] + 1 for i in lr]))

Solution (Python):

n = int(input())
count = 0
for i in range(n):
    l, r = map(int, input().split())
    count += (r-l+1)

print(count)

Solution (Python):
print(sum(1-eval(input().replace(' ','-')) for i in range(int(input()))))

Solution (Python):
_,*l=map(int,open(0).read().split())
print(sum(j-i+1 for i,j in zip(l[::2],l[1::2])))

Solution (Python):
n=int(input())
s=0
for i in range(n):
    l,r=map(int,input().split())
    s+=(r-l+1)
print(s)

Solution (Python):
N = int(input())
S = ['0']*100000
for i in range(N):
  l,r = map(int,input().split(' '))
  S[l-1:r] = ['1'for i in range(r-l+1)]
print(S.count('1'))

Solution (Python):
print(sum(1-eval(input().replace(" ","-")) for _ in range(int(input()))))

Solution (Python):
n = int(input())
sum = 0
for i in range(n):
  l, r = map(int, input().split())
  sum += r-l+1
print(sum)

Solution (Python):
N = int(input())
ans = 0

for i in range(N):
    l, r = map(int, input().split())
    ans += r - (l - 1)
print(ans)

Solution (Python):
N = int(input())
a = 0
for _ in range(N):
  a = a + abs(eval(input().replace(" ", "-"))) + 1
print (a)

Solution (Python):
n = int(input())
seats = [list(map(int,input().split())) for _ in range(n)]
ans = 0
for s in seats:
    ans += s[1]-s[0]+1
print(ans)

Solution (Python):
print(sum(1-eval(input().replace(" ","-")) for i in range(int(input()))))

Solution (Python):
N = int(input())
ans = 0
for i in range(N):
    l, r = map(int, input().split())
    ans += r-l+1
print(ans)

Solution (Python):
N=int(input())
res=0
for n in range(N):
  l,r=[int(x) for x in input().split()]
  res+=r-l+1
else:
  print(res)

Solution (Python):
N = int(input())
l = [list(map(int, input().split())) for _ in range(N)]

cnt = 0
for i in l:
    if i[0] == i[1]:
        cnt += 1
    else:
        cnt += i[1] - i[0] + 1

print(cnt)

Solution (Python):
n = int(input())
ans = 0
for i in range(n):
  l,r = map(int,input().split())
  ans += r - l + 1
print(ans)

Solution (Python):
N = int(input())

ans = 0

for _ in range(N):
	l, r = [int(x) for x in input().split()]
	ans += r - l + 1

print(ans)

Solution (Python):
N = int(input())
ans = 0
for i in range(N):
    l, r = map(int,input().split())
    ans += r - l + 1
print(ans)

Solution (Python):
if __name__ == '__main__':

  N = int(input())
  lr_listr = [list(map(int, input().split())) for i in range(N)]
  
  answer = 0
  for i in range(N):
    lr = lr_listr[i]
    answer += lr[1] - lr[0] + 1
  print(answer)

Solution (Python):
n,b=int(input()),0
for i in range(n):
    a=list(map(int,input().split()))
    b+=a[1]-a[0]+1
print(b)

Solution (Python):
n = int(input())
count = 0
for i in range(n):
    l,r = map(int,input().split())
    count += r-l+1
print(count)

Solution (Python):
import collections
n = int(input())
l = [list(map(int, input().split())) for _ in range(n)]
d = {}
for i in range(len(l)):
    for j in range(l[i][0], l[i][1] + 1):
        d[j] = 1
print(len(d))

Solution (Python):
N = int(input())

nAns = 0
Tmp = []

for i in range(N):
  Tmp = input().rstrip().split(' ')
  nS = int(Tmp[0])
  nE = int(Tmp[1])
  nAns += (nE-nS+1)
print(nAns)

Solution (Python):
N=int(input())
lrN=[list(map(int,input().split()[:2])) for _ in range(N)]
ret=0
for lri in lrN:
    ret+=lri[1]-lri[0]+1

print(ret)

Solution (Python):
n = int(input())
a = [list(map(int, input().split())) for i in range(n)]

ans = 0
for i in range(len(a)):
    ans += a[i][1]-a[i][0] +1
print(ans)

Solution (Python):
n = int(input())
a = [list(map(int,input().split())) for i in range(n)]
ans = 0
for i in range(n):
  ans += a[i][1] - a[i][0] + 1
print(ans)

Solution (Python):
n = int(input())
ans = 0
for _ in range(n):
    l, r = map(int, input().split())
    ans += r - l + 1
print(ans)

Solution (Python):


def main():

    N = int(input())
    numList = [list(map(int,input().split())) for _ in range(N)]
    ans = 0

    for l,r in numList:
        ans += r-l+1
    
    print(ans)








    
if __name__== "__main__":
    main()

Solution (Python):
n = int(input())
li = [list(map(int, input().split())) for _ in range(n)]
sum = 0
for l in li:
    sum += (l[1] - l[0] + 1)
print(sum)

Solution (Python):
N=int(input())
ans=0
for i in range(N):
    l,r=map(int,input().split())
    ans+=r-l+1
print(ans)

Solution (Python):
n = int(input())
res = 0
for i in range(n):
  l,r = map(int,input().split())
  res += r-l+1
print(res)

Solution (Python):
n = int(input())
x = 0
for i in range(n):
    l, r = map(int, input().split())
    x += r - l + 1
print(x)

Solution (Python):
n = int(input())
rows = [list(map(int,input().split())) for i in range(n)]

ans_count = 0
for row in rows:
    ans_count += row[1] - row[0] + 1

print(ans_count)

Solution (Python):
N = int(input())
x = []
y = []
for i in range(N):
    x1,y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)

count = 0

for i in range(N):
    count += y[i] - x[i] + 1 

print(count)

Solution (Python):
N = int(input());
count = 0;

for i in range(N):
  l, r = map(int, input().split());
  count += r - l + 1;

print(count);

Solution (Python):
sum=0
n=int(input())
for i in range(n):
	a,b=map(int,input().split())
	sum+=b-a+1
print(sum)

Solution (Python):



N = int(input())
num = 0
for _ in range(N):
    l, r = map(int, input().split(' '))
    num += r - l + 1
print(num)

Solution (Python):
n = int(input())
people = 0
for i in range(n):
    l, r = map(int, input().split())
    people += -l+r+1
print(people)

Solution (Python):
n = int(input())
ans = 0
for i in range(n):
    l,r = map(int,input().split())
    ans += r - l + 1
print(ans)

Solution (Python):

import sys
INF = float("inf")


def solve(N: int, l: "List[int]", r: "List[int]"):
    counter = 0
    for i in range(N):
        counter += r[i]-l[i]+1
    print(counter)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    l = [int()] * (N)  
    r = [int()] * (N)  
    for i in range(N):
        l[i] = int(next(tokens))
        r[i] = int(next(tokens))
    solve(N, l, r)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
ll = [list(map(int,input().split())) for _ in [0]*n]
ans = 0
for l in ll:
  ans += l[1]-l[0]+1
print(ans)

Solution (Python):

n = int(input())
total = 0
for i in range(n):
    l, r = [int(el) for el in input().split(' ')]
    total += r - l + 1
print(total)

Solution (Python):
n=int(input())
box=[list(map(int,input().split())) for _ in range(n)]

sum=0
for i in range(n):
  sum+=box[i][-1]-box[i][0]+1
print(sum)

Solution (Python):
n = int(input())
li = [0]*100000

for i in range(n):
    l,r = map(int,input().split())
    for j in range(l-1,r):
        
        li[j] = 1
    
print(sum(li))

Solution (Python):
n=int(input())

sum=0

for i in range(n):
    l,r=map(int,input().split())
    sum+=r-l+1
print(sum)

Solution (Python):
N = int(input())
ans = 0
for i in range(N):
    i, j = map(int, input().split())
    ans += j - i + 1

print(ans)

Solution (Python):
n = int(input())
L, R = [], []

for i in range(n):
  l, r = map(int, input().split())
  L.append(l)
  R.append(r)

s = sum([r-l+1 for (l, r) in zip(L, R)])
print(s)

Solution (Python):
n = int(input())
sum = 0
for i in range(n):
  l,r = map(int,input().split())
  sum += r - l + 1
print(sum)

Solution (Python):
N = int(input())
a = []
for i in range(N):
    a.append(list(map(int, input().split())))
    
number = 0
    
for i in range(N):
  abc = a[i-1]
  first = abc[0]
  last = abc[1]
  abc_number = last - first + 1
  number += abc_number

print(int(number))

Solution (Python):
N = int(input())
A = 0
for _ in range(N):
  l, r = [int(x) for x in input().split()]
  A+=r-l+1
print(A)

Solution (Python):
n = int(input())
ans = 0
for i in range(n):
    l, r = map(int, input().split())
    ans += (r-l+1)
print(ans)

Solution (Python):

import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math






def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    N = inputInt()
    lr = []
    for _ in range(N):
        l,r = inputMap()
        lr.append((l,r))
        
    ans = 0
    for i in lr:
        l,r = i
        ans += r-l+1
    
    print(ans)
            	
if __name__ == "__main__":
	main()

Solution (Python):
N = int(input())
ans = 0
for _ in range(N):
  l, r = map(int, input().split())
  ans += r - l + 1
print(ans)

Solution (Python):
N = int(input())
cnt = 0
for i in range(N):
    l, r = map(int, input().split())
    cnt += (r-l) + 1

print(cnt)

Solution (Python):
n = int(input())
count = 0
for i in range(n):
  l, r = map(int, input().split())
  count += (r - l + 1)
print(count)

Solution (Python):
N = int(input())
a = 0

for i in range(N):
  l,r = list(map(int,input().split()))
  a+=r-l+1

print(a)

Solution (Python):
n = int(input())
lr = [list(map(int, input().split())) for i in range(n)]
ans = 0
for i in range(n):
    ans += lr[i][1] - lr[i][0] + 1
print(ans)

Solution (Python):
N = int(input())
a = [0] * N
b = [0] * N
ans = 0
for i in range(N):
  a[i], b[i] = map(int, input().split())
  ans += b[i] - a[i] + 1

print(ans)

Solution (Python):
n = int(input())
l = [list(map(int, input().split())) for i in range(n)]
ans = 0
for i in l:
    num = i[1] - i[0]
    ans += num + 1
print(ans)

Solution (Python):
n = int(input())
li = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for i in range(n):
  ans += li[i][-1] - li[i][0] + 1
print(ans)

Solution (Python):
n = int(input())
sum = 0
for i in range(n) :
  a, b = map(int, input().split())
  sum += b - a + 1
print(sum)

Solution (Python):
N = int(input())
LR = [list(map(int,input().split())) for _ in range(N)]

res = 0
for i in range(N):
    res += LR[i][1]-LR[i][0]+1
print(res)

Solution (Python):
n = int(input())
total = 0
for i in range(n):
    l,r = map(int, input().split())
    total += r - l + 1
print(total)

Solution (Python):
a = int(input())
b = 0
for i in range(a):
    c, d = map(int, input().split())
    b += (abs(d-c)+1)
print(b)

Solution (Python):
N = int(input())
ans = 0
for _ in range(N):
     l, r = map(int, input().split())
     ans += r - l + 1
print(ans)

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007


def A():
    s = S()
    if "9" in s:
        print("Yes")
    else:
        print("No")
    return


def B():
    n = II()
    ans = 0
    for i in range(n):
        l, r = LI()
        ans += r - l + 1
    print(ans)
    return


def C():
    n = II()
    A = {}
    for _ in range(n):
        k = II()
        if not k in A:
            A[k] = 1
        else:
            A[k] += 1
    ans = 0
    for item in A.values():
        ans += item % 2
    print(ans)
    return


def D():
    return


if __name__ == '__main__':
    B()

Solution (Python):
n = int(input())
l = [0]*n
r = [0]*n
for i in range(n):
    l[i], r[i] = map(int, input().split())
cnt = 0
for i in range(n):
    cnt += r[i] - l[i] + 1
print(cnt)

Solution (Python):
x,*y=map(int,open(0).read().split())
print(sum(y[1::2])-sum(y[0::2])+x)

Solution (Python):
n=int(input())
s=0
for _ in [0]*n:s-=eval(input().replace(' ','-'))-1
print(s)

Solution (Python):
N = int(input())
lr = [list(map(int,input().split())) for i in range(N)]

ans = 0
for l,r in lr:
  ans += r-l +1

print(ans)

Solution (Python):
a = int(input())
b = 0
for i in range(a):
    c, d = map(int, input().split())
    b += abs(c-d)+1
print(b)

Solution (Python):
ans = 0
for i in range(int(input())):
    l,r = map(int,input().split())
    ans += r-l+1
print(ans)

Solution (Python):
n = int(input())
L = [0] * n
R = [0] * n
for i in range(n):
    L[i], R[i] = map(int, input().split())
ans = 0
for i in range(n):
    ans += R[i] - L[i] + 1
print(ans)

Solution (Python):
n = int(input())
lr = [list(map(int, input().split()))for i in range(n)]
cnt = 0
for i in range(n):
  cnt += lr[i][1] - lr[i][0] + 1
print(cnt)

Solution (Python):
n = int(input())
lr = [input().split() for i in range(n)]
lr = [[int(lr[i][0]), int(lr[i][1])] for i in range(n)]
cnt = 0
for i in range(n):
  cnt += lr[i][1] - lr[i][0] + 1
print(cnt)

Solution (Python):
n=int(input())
a=[[int(j) for j in input().split()] for i in range(n)]
b=0
for (i,j) in a:
  b+=j-i
  
print(b+n)

Solution (Python):
N = int(input())
total = 0
for i in range(N):
  l, r = map(int, input().split())
  total += r - l + 1
print(total)

Solution (Python):

N = int(input())
lr = []
for i in range(N):
    lr.append(list(map(int, input().split())))
    
ans = 0    
for i in range(N):
    ans += lr[i][1] - lr[i][0] + 1
print(ans)

Solution (Python):
N=int(input())

ans=0
for i in range(N):
    a,b=map(int,input().split())
    ans+=(b-a+1)
print(ans)

Solution (Python):
n=int(input())
ans=0
for i in range(n):
  li=[int(x) for x in input().split()]
  a=li[1]-li[0]+1
  ans+=a
print(ans)

Solution (Python):
n = int(input())

s = 0

for i in range(n):
    n = input().split()
    s += int(n[1]) - int(n[0]) + 1

print(s)

Solution (Python):
n = int(input())
a = [list(map(int, input().split(" "))) for i in range(n)]
print(sum(x[1] - x[0] + 1 for x in a))

Solution (Python):



N = int(input())
arr = [list(map(int, input().split())) for i in range(N)]
ctr = 0

for i in range(N):
    ctr += arr[i][1] - arr[i][0] + 1
print(ctr)

Solution (Python):
N = int(input())
count = 0
for i in range(N):
  a,b = map(int, input().split())
  count += b - a + 1
print(count)

Solution (Python):
N = int(input())
ans = 0
for i in range(N):
  l, r = map(int, input().split())
  ans += r - l + 1
print(ans)

Solution (Python):
n = int(input())
ans = 0
for i in range(n):
    l, r = map(int, input().split())
    ans += r-l+1
print(ans)

Solution (Python):
N = int(input())
nums = [ list(map(int, input().split())) for _ in range(N)]

s = 0
for n in range(N):
    s += nums[n][1] - nums[n][0] + 1

print(s)

Solution (Python):
N = int(input())
result = 0
for _ in range(N):
    f, t = map(int, input().split())
    result += t - f + 1
print(result)

Solution (Python):
n = int(input())
ans=0
for i in range(n):
    l,r=map(int,input().split())
    ans = ans+r-l+1
print(ans)

Solution (Python):
n=int(input())
l=[]

for i in range(n):
    tmp=list(map(int, input().split()))
    l.append(tmp[1]-tmp[0]+1)

print(sum(l))

Solution (Python):
N = int(input())
cnt = 0
for i in range(N):
        st, ed = map(int, input().split())
        num = ed+1 - st
        cnt = cnt + num
print(cnt)

Solution (Python):
print(sum([sum([int(x[0]) * -1, int(x[1]), 1]) for x in [input().split() for i in range(int(input()))]]))

Solution (Python):
a = int(input())
b = []

for i in range(a):
  c = list(map(int,input().split()))
  b.append(c[1]-c[0]+1)
else:
  print(sum(b))

Solution (Python):
N = int(input())
ans = 0
for _ in range(N):
    l, r = map(int, input().split())
    ans += r - l + 1
print(ans)

Solution (Python):
n = int(input())
ans = 0
for i in range(n):
    l,r = map(int,input().split())
    ans += r-l+1
print(ans)

Solution (Python):
N = int(input())
box = [list(map(int, input().split())) for a in range(N)]

sum = 0
for i in range(N):
    sum += box[i][-1] - box[i][0] + 1
print((sum))

Solution (Python):
n = int(input())
d = [list(map(int,input().split())) for _ in range(n)]
print(sum([d[i][1]-d[i][0]+1 for i in range(n)]))

Solution (Python):
ans=0
n=int(input())
for _ in range(n):
    r,l=map(int,input().split())
    ans=ans+l-r+1
print(ans)

Solution (Python):
def print_ans(l,r,N):
  """print(sum(r)-sum(l)+N)
  Parameters
  --------------
  >>> print_ans([24],[30],1)
  7
  >>> print_ans([6,3],[8,3],2) 
  4
  """
  print(sum(r)-sum(l)+N)


  

def main():
  N = int(input())
  l = []
  r = []
  for i in range(N):
    s = list(map(int,input().split()))
    l.append(s[0])
    r.append(s[1])

  print_ans(l,r,N)


if __name__ == '__main__':
  main()

Solution (Python):
print(sum([m[1]+1-m[0] for m in [list(map(int,input().split())) for i in range(int(input()))]]))

Solution (Python):
N = int(input())
x = 0
for i in range(N):
  l, r = map(int, input().split())
  x += r - l + 1
print(x)

Solution (Python):
N = int(input())
A= [list(map(int,input().split(" "))) for i in range(N)]

sum=0
for i in A:
    sum+=i[1]-i[0]+1
print(sum)

Solution (Python):
n = int(input())
count = 0

for _ in range(n):
    l, r = map(int, input().split())
    count += r-l+1

print(count)

Solution (Python):
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N = n()
total = 0
for i in range(N):
    l, r = nl()
    total += r - l + 1
print(total)

Solution (Python):
from collections import Counter
from collections import deque
from functools import reduce
from pprint import pprint
import bisect
import copy
import fractions
import itertools
import math
import queue
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers): return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers): return reduce(LCM, numbers)
def LCM(m, n): return (m * n // fractions.gcd(m, n))


n = II()
lr = [LI() for _ in range(n)]
cnt = 0
for i in lr:
    cnt += (i[1] - i[0] + 1)
print(cnt)

Solution (Python):
n=int(input())
nums=[]
for i in range(n):
    nums.append(list(map(int,input().split())))


ans=[]
for j in nums:
    ans.append(j[1]-j[0]+1)

print(sum(ans))

Solution (Python):

n = int(input())
ans = 0
for i in range(n):
    a, b = map(int, input().split())
    ans += b - a + 1
print(ans)

Solution (Python):
n=int(input())
c=0
for i in range(n):
  a,b=map(int,input().split())
  c+=b-a+1
print(c)

Solution (Python):
n=int(input())
o=0
for i in range(n):
    l,r=map(int,input().split())
    o+=r-l+1
print(o)

Solution (Python):
n=int(input())
ans=0
for _ in range(n):
    l,r=map(int,input().split())
    ans+=r-l+1
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline

n = int(input())
sum = 0
for i in range(n):
    l, r = map(int, input().split())
    sum += r+1-l
print(sum)

Solution (Python):
N = int(input())
ans = 0
for _ in range(N):
    l, r = map(int, input().split())
    ans += r - l + 1
print(ans)

Solution (Python):
def abc():
    n = int(input())
    ans = 0
    for i in range(n):
        l, r = map(int, input().split())
        ans += r - l + 1
    print(ans)


abc()

Solution (Python):
def main():
    N = int(input())
    ans = 0
    for _ in range(N):
        l, r = map(int, input().split())
        ans += r - l + 1
    print(ans)


main()

Solution (Python):
n = int(input())
input_list = []
for i in range(n) :
    a = [int(num) for num in input().split()]
    input_list.append(a)

count = 0
for i in input_list :
        count += (i[1]-i[0]+1)

print(count)

Solution (Python):
N = int(input())
ans = 0
for i in range(N):
    l,r = map(int, input().split())
    ans += r - l + 1
print(ans)

Solution (Python):
N = int(input())
ans = 0
for i in range(N):
    l, r = map(int, input().split())
    ans += r - l + 1

print (ans)

Solution (Python):
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys
import string

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")






N = int(sys.stdin.readline())
L, R = list(zip(*[map(int, sys.stdin.readline().split()) for _ in range(N)]))
L = np.array(L)
R = np.array(R)
print(sum(R-L+1))

Solution (Python):
n = int(input())
li = [list(map(int,input().split())) for i in range(n)]
ans = 0
for i in range(n):
  ans += li[i][1] - li[i][0] +1
print(ans)

Solution (Python):
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys
import string

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

N = int(sys.stdin.readline())
L, R = np.array(list(zip(*[map(int, sys.stdin.readline().split()) for _ in range(N)])))

print((R - L + 1).sum())

Solution (Python):
from sys import stdin
N = int(stdin.readline().rstrip())
data = []
for _ in range(N):
    data.append([int(x) for x in stdin.readline().rstrip().split()])

ans = 0
for i in data:
    ans += (i[1] - i[0] + 1)
print(ans)

Solution (Python):
n = int(input())
ans = 0
for _ in range(n) :
        l = list(map(int, input().split()))
        ans += l[1] - l[0] + 1
print(ans)

Solution (Python):
N = int(input())
l = []
for i in range(N):
    l.append(list(map(int, input().split())))

ans = 0

for i in range(N):
    ans += l[i][1]-l[i][0]+1

print(ans)

Solution (Python):
n = int(input())
lst = []
for i in range(n):
    lst.append(input().split())
ans = 0
for i in lst:
    l = i[1]
    r = i[0]
    ans += (int(l) - int(r) + 1) 

print(ans)

Solution (Python):
from collections import defaultdict

def main():
    num = int(input())
    ans = 0
    for i in range(num):
        a, b = map(int, input().split())
        ans += b - a + 1
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())

answer = 0
for _ in range(n):
  a,b = map(int,input().split())
  answer += b-a+1

print(answer)