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):
import sys
input = sys.stdin.readline
N = int(input())
res = 0
for _ in range(N):
  l, r = map(int, input().split())
  res += r - l + 1
print(res)

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):
res = 0
for i in range(int(input())):
	l, r = map(int, input().split())
	res += r - l + 1
print(res)

Solution (Python):
n = int(input())
l,r,ans =[0] * n,[0] * n,[0] * n
for i in range(n):
    l[i],r[i] = map(int, input().split())
    ans[i] = r[i] - l[i] + 1
print(sum(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 = []
for i in range(n) :
    ans += [r[i] - l[i] + 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())
res=0
for _ in range(n):
    a,b=map(int,input().split())
    res+=b-a+1
print(res)

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

Solution (Python):
n=int(input())
l=[list(map(int,input().split())) for i 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())
ans = 0
for _ in range(N):
    l,r = map(int,input().split())
    ans += r-l+1
print(ans)

Solution (Python):
dantai = int(input())
lis = []
for _ in range(1, dantai+1):
  lis.append(input())
cus = 0
for a in lis:
  b1, b2= a.split()
  cus = cus + (int(b2)-int(b1)) + 1
print(cus)

Solution (Python):
def examB():
    N = I()
    cur =  0
    for _ in range(N):
        l, r = LI()
        cur += (r-l+1)
    print(cur)

import sys
import copy
import bisect
import heapq
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()

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())
s = 0
for i in range(n):
    l,r = map(int,input().split())
    s  += r-l+1
print(s)

Solution (Python):

n = int(input())

l = []
r = []
for i in range(n):
    tmp = [int(s) for s in input().split()]
    l.append(tmp[0])
    r.append(tmp[1])

audiences = 0

for i in range(n):
    audiences += r[i] - l[i] + 1

print(audiences)

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())
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())
num = 0
for i in range(n):
  L = list(map(int, input().split()))
  num += L[1] - L[0] + 1
print(num)

Solution (Python):


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

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

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())
l=[]
ans=0
for i in range(n):
  l.append(input().split())
for i in range(n):
  ans+=int(l[i][1])-int(l[i][0])+1
print(ans)

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

Solution (Python):
import sys
sys.setrecursionlimit(10**6)

N = int(input())
ans=0
for i in range(N):
    li, ri = map(int,input().split())
    ans += ri-li+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 = input()

i = 0
result = 0
ans = 0
while i < int(N):
    l = []
    l = input().split()
    result = int(l[1]) - int(l[0]) + 1
    ans = ans + result
    i += 1

print(ans)

Solution (Python):
N = int(input())
ltlist = [list(map(int, input().split())) for _ in range(N)]
num = 0
for l, t in ltlist:
    num += t - l
print(num + N)

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
cnt = 0
for i in range(n):
    l,r = inpl()
    cnt += r-l+1
print(cnt)

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

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

print(count)

Solution (Python):

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

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

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

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

Solution (Python):
from sys import stdin

n, *s = (int(x) for x in stdin.read().split())

seats = 0
for l, r in zip(* [iter(s)] * 2):
    seats += r - l + 1

print(seats)

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

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

print(summary)

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

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

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())
cnt=0
for _ in range(n):
    l,r=map(int,input().split())
    cnt += r-l+1
print(cnt)

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

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):
import sys
from functools import reduce
import copy
import math
from pprint import pprint
import collections
import bisect


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    sheets = list(map(string_to_int, inputs))
    count = 0
    for s in sheets:
        count += s[1] - s[0] + 1
    return count


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    N = int(input())
    ret = solve(inputs(N))
    print(ret)

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 = []
y = []
for i in range(0,N):
    x1,y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)

total=0
for j in range(0,N):
    if x[j]<y[j]:
        total=total+y[j]-x[j]+1
    elif x[j]==y[j]:
        total+=1    
print(total)

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

sum = 0

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

print(sum)

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())
cnt = 0

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

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):
def count(s):
  l, r = map(int, s.split())
  return r - l + 1

N = int(input())
audiences = [ count(input()) for _ in range(N) ]

print(sum(audiences))

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())
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):
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())
count = 0
for i in range(N):
    l,r  = list(map(int,input().split()))
    count += r-l+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())
l = [0] * n
r = [0] * n
for i in range(n):
  l[i], r[i] = map(int, input().split())
a=0
for i in range(n):
  a=a+r[i]-l[i]+1
print(a)

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

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())
ans=0
for i in range(n):
    a,b=map(int,input().split())
    ans+=b-a+1
print(ans)

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

Solution (Python):
N = int(input())
lr = [list(map(int, input().split())) for _ 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())
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,r = map(int,input().split())
    ans += r-l+1
print(ans)

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

for n 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())
num = 0
for _ in range(n):
    l, r = map(int, input().split())
    num += r - l + 1
print(num)

Solution (Python):

def main():
    N, *LR = 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()

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 += r-l+1 
print(count)

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

count = 0
for g in group:
    count += g[1]-g[0]+1

print(count)

Solution (Python):

N = int(input())
group = [[0,0]for _ in range(N)]
sum=0
for i in range(N):
    group[i] = list(map(int, input().split()))
    sum += abs(group[i][1]-group[i][0])+1
print(sum)

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    t = 0
    for i in range(n):
        l, r = list(map(int, input().rstrip('\n').split()))
        t += (abs(r - l) + 1)
    print(t)


if __name__ == '__main__':
    slove()

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

for i in range(N):
    l, r = map(int, input().split())
    ans += abs(l-r) + 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())
ans = 0
for i in range(N):
  l,r = map(int, input().split())
  ans += r-l+1
  
print(ans)

Solution (Python):
n = int(input())
s = 0
a = [input().split() for i in range(n)]

l = [0]
r = [0]
for m in range(n):
    l.append(a[m][0])
    r.append(a[m][1])

for p in range(1,n+1):
    s += int(r[p])-int(l[p])+1

print(s)

Solution (Python):
n = int(input())
s = 0
a = [input().split() for i in range(n)]

l = [0]
r = [0]
for m in range(n):
    l.append(a[m][0])
    r.append(a[m][1])

for p in range(1,n+1):
    s += int(r[p])-int(l[p])+1

print(s)

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

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):
res = 0
for _ in range(int(input())):
    l, r = map(int, input().split())
    res += (r - l + 1)
print(res)

Solution (Python):

N, *l_r = [list(map(int, i.rstrip("\n").split())) for i in open(0).readlines()]


print(sum([l_r[i-1][1] - l_r[i-1][0] + 1 for i in range(N[0])]))

Solution (Python):
print(sum(1-eval(input().replace(" ", "-")) for _ 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())
a=[list(map(int,input().split())) for i in range(N)]
count = 0

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

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

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

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

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

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

Solution (Python):
n=int(input())
l=[list(map(int,input().split())) for i in range(n)]
cnt=0
for i in range(n):
    cnt+=l[i][-1]-l[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())
s=[list(map(int,input().split()))for i in range(n)]
c=0
for i in range(n):
    c+=s[i][1]-s[i][0]+1
print(c)

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

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())
cnt =[]
for i in range(n):
  l,r = map(int, input().split())
  a = r-l +1
  cnt.append(a)
print(sum(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())

cnt = 0

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

print(cnt)

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())
cnt = [0]*100002
for i in range(N):
  l, r = map(int, input().split())
  for j in range(l, r+1):
    cnt[j]=1
print(sum(cnt))

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

Solution (Python):
n = int(input())
total = 0
for _ in range(n):
    l, r = map(int, input().split())
    val = (r+1) - l
    total += val
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):
import sys
input = sys.stdin.readline


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

    
if __name__ == '__main__':
    main()

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

Solution (Python):
n = int(input())
cnt = 0
for i in range(0, 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):
  a, b =map(int,input().split())
  ans+=b-a+1
print(ans)

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

for i in range(n):
    l_temp, r_temp = map(int, input().split())
    ocu_temp = r_temp - l_temp + 1
    ocu = ocu + ocu_temp

print(ocu)

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

Solution (Python):
ans=0
n=int(input())
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):
    x,y = map(int,input().split())
    ans+=y-x+1
print(ans)

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


if __name__ == "__main__":
    resolve()

Solution (Python):
print(sum([-eval(input().replace(' ', '-')) + 1 for _ in range(int(input()))]))

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())
audience = 0
for i in range(N):
    l, r = map(int, input().split())
    audience += r - l + 1
print(audience)

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())
res = 0
for _ in range(n):
    l, r = map(int, input().split())
    res += r - l + 1
print(res)

Solution (Python):
import sys
import math
from fractions import gcd





def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""


 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())


 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""


N = int(sys.stdin.readline())
ans = 0
for _ in range(N):
    l, r = map(int, sys.stdin.readline().split())
    ans += r - l + 1
print(ans)

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

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

print(result)

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):
    a,b=map(int,input().split())
    ans+=b-a+1
print(ans)

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

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

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

Solution (Python):
N = int(input())
ans = 0
for _ in range(N):
    l, r = tuple(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())
cnt = 0
for i in range(n):
    l,r = map(int,input().split());cnt += r-l+1
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())
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 i in range(N):
  l, r = map(int, input().split())
  count += (r-l+1)
  
print(count)

Solution (Python):
import numpy as np
N = int(input())
lr = [list(map(int,input().split())) for _ in range(N)]
seat = np.zeros(100000,dtype=int)
for l,r in lr:
  seat[l-1:r] = 1
print(sum(seat))

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

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

cnt = 0

for l, r in L:
    cnt += r-l+1
print(cnt)

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

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

Solution (Python):
ans=0
for _ in range(int(input())):
    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):
p = 0
for i in range(int(input())):
    l,r = map(int,input().split())
    p += r - l + 1
print(p)

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())
lr= [list(map(int, input().split())) for _ in range(n)]

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

Solution (Python):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
    
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())
ans = 0
for i in range(N):
    l, r = map(int, input().split())
    ans += r - l +1
print(ans)

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

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

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

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

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

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

if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
lr=[]
ans=0
for i in range(n):
    lr.append(list(map(int,input().split())))
    ans+=lr[-1][1]-lr[-1][0]+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())
ans = 0
for _ in range(N):
    l, r = map(int, input().split())
    ans += r - l + 1
print(ans)

Solution (Python):

import sys


def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

N = II()
ans = 0
for i in range(N):
    a, b = ISI()
    ans += b - a + 1
print(ans)

Solution (Python):
import sys
import copy
import  math
import bisect
from collections import *
from operator import itemgetter
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
ans = 0
for i in range(n):
    l, r = na()
    ans += r - l + 1
print(ans)

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

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

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

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

Solution (Python):
n = int(input())
lr = [list(map(int, input().split())) for _ 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())
sum=0
for i in range(N):
  a,b=map(int,input().split())
  sum=sum+b-a+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):
a=0
for _ in range(int(input())):
    x,y=map(int,input().split())
    a+=y-x+1
print(a)

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

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

print(ans)

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())
p=0
for i in range(n):
  p1, p2 = map(int, input().split())
  p += p2-p1+1
print(p)

Solution (Python):
N = input()
ni = lambda: int(N)
nm = lambda: map(int, input().split())
li = lambda: [nl() for _ in range(ni())]
nl = lambda: list(nm())
lx = lambda: [x[1] - x[0] + 1 for x in li()]
print(sum(lx()))

Solution (Python):
import sys
stdin = sys.stdin
def input():
  return stdin.readline().strip()
print(sum(s[1] - s[0] + 1 for s in [list(map(int, input().split())) for _ in range(int(input()))]))

Solution (Python):
print(sum(s[1] - s[0] + 1 for s in [list(map(int, input().split())) for _ 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())
s = 0
for i in range(N):
  l, r = map(int, input().split())
  s = s + 1 + (r-l)
print(s)

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

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

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

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

Solution (Python):
N = int(input())
x_set = set()
x = [[int(i) for i in input().split()] for j in range(N)]
for i, j in enumerate(x):
    for k in range(j[0], j[1]+1):
        x_set.add(k)
print(len(x_set))

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

for i in range(n):
  a,b = [int(j) for j in input().split()]
  sum += b-a+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())
ans = 0
for i in range(n):
    l,r = map(int,input().split())
    ans +=  r - l + 1
print(ans)

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



if __name__ == '__main__':
    print(main())

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

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

Solution (Python):
N = int(input())
lr = [list(map(int, input().split())) for _ 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())
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())
re = 0
for i in range(N):
  l, r = map(int, input().split())
  re += r-l+1
print(re)

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())
t = 0
for i in range(n):
    l, r = map(int, input().split())
    t += (r - l + 1)
print(t)

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
for _ in range(int(input())):
    l, r = map(int, input().split())
    sum += (r - l + 1)
print(sum)

Solution (Python):
sum = 0
for _ in range(int(input())):
    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 = (int(i) for i in input().split())
    ans += r - l + 1
print(ans)

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

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

ans=0
for lr in lrs:
  for i in range(lr[0]-1,lr[1]):
    ans+=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())
S = [list(map(int, input().split())) for i in range(N)]
a=0
for i in range(N):
  a+=S[i][-1]-S[i][0]+1
print(a)

Solution (Python):
import sys
stdin = sys.stdin
 
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
s = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

n = ni()
c = 0
for i in range(n):
    l, r = na()
    c += (r - l) + 1

print(c)

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

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 = map(int, input().split())
    ans += r - l + 1
print(ans)