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

Solution (Python):
from typing import List


def answer(n: int, lrs: List[List[int]]) -> int:
    number_of_people_sitting = 0
    for lr in lrs:
        l, r = lr
        number_of_people_sitting += r - l + 1

    return number_of_people_sitting


def main():
    n = int(input())
    lrs = [map(int, input().split()) for _ in range(n)]
    print(answer(n, lrs))


if __name__ == '__main__':
    main()

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

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

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

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 _ 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 = input().split()
   ans += int(L[1]) - int(L[0]) + 1

print(ans)

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

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

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())
ll=[]
rr=[]
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 = list(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):
with open(0) as f:
    N, *lr = map(int, f.read().split())
print(sum(lr[1::2])-sum(lr[::2])+N)

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

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)


if __name__ == "__main__":
    main()

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

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

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

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

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

res = 0

for i in range(10 ** 5):
    if seat[i] == 1:
        res += 1
print(res)

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

for i in range(1, 10 ** 5):
    seat[i] += seat[i - 1]

res = 0
for i in range(10 ** 5):
    if seat[i] == 1:
        res += 1
print(res)

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())
seat = [0] * 10 ** 6
for i in range(n):
    l, r = map(int, input().split())
    for j in range(l, r + 1):
        seat[j - 1] = 1

res = 0
for i in range(10 ** 6):
    if seat[i] == 1:
        res += 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):
n=int(input())
kei=0
for i in range(n):
    l,r=map(int,input().split())
    kei += r-l+1
print(kei)

Solution (Python):
N, *_LR = map(int, open(0).read().split())
LR = list(zip(*[map(int, iter(_LR))]*2))

ans = 0

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

Solution (Python):
n = int(input())
l = [0] * n
r = [0] * n
for i in range(n):
    l[i],r[i] = map(int, input().split())
res = 0

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

print(res)

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    seq = [False] * 100000

    for _ in range(N):
        l, r = map(int, readline().split())
        l -= 1
        for i in range(l, r):
            seq[i] = True

    print(seq.count(True))


if __name__ == '__main__':
    main()

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

Solution (Python):
from sys import stdin
def input():
    return stdin.readline().strip()

n = int(input())

ans = 0

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

print(ans)

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

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

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

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

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


if __name__ == '__main__':
    main()

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


if __name__ == '__main__':
    main()

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

print(cnt)

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

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())

num = 0

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

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

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

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

ans = 0
for i in num_person:
    ans += i

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())
ans=0
for i 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):
  s,g = map (int, input ().split ())
  le = g-s+1
  x += le
print (x)

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

Solution (Python):


n = int(input())
men = []
for i in range(n):
    l, r = map(int, input().split())
    men.append([l, r])
ans = 0

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

print(ans)

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

ans = 0
for l, r in A:
    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())
l = [tuple(map(int, input().split())) for i in range(n)]

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

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

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

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 math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
li = np.zeros(200000)
for _ in range(n):
  l, r = rm()
  li[l:r+1] = 1
print(int(sum(li)))

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

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

print(total)

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

print(ans)

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

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

Solution (Python):
N = int(input())
ppl = 0
for i in range(N):
  tmp = input().split(" ")
  ppl += int(tmp[1]) - int(tmp[0]) + 1

print(ppl)

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

Solution (Python):
N = int(input())
p = 0
for i in range(N):
  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())

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):
print(sum(1-eval(input().replace(" ","-")) for _ in range(int(input()))))

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

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

Solution (Python):
lr = []
l = []
r = []
n = int(input())
c = 0
for i in range(0,n):
    lr = input().split()
    l.append(int(lr[0]))
    r.append(int(lr[1]))

for i in range(0,n):
    if l[i] == r[i]:
        c += 1
    else:
        c += (1 + r[i] - l[i])

print(c)

Solution (Python):
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n = i_input()
    num_list = i_row_list(n)

    count = 0

    for l, r in num_list:
        count += r - l + 1

    print(count)

if __name__ == '__main__':
    main()

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

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):
import sys
def input(): return sys.stdin.readline().strip()


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):

















import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
ans = 0
for i in range(N):
    l, r = MAP()
    ans = ans + (r - l + 1)
print(ans)

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

    print(ans)

if __name__ == "__main__":
    solve()

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

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

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

ans = 0
for s in Seat:
	ans += s[1] - s[0] + 1
print(ans)

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

Solution (Python):
Num = 0
for T in range(int(input())):
    L,R = (int(X) for X in input().split())
    Num += R-L+1
print(Num)

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *LR = map(int, read().split())

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

    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
a=0
for _ in range(n):
    l,r=map(int,input().split())
    a+=r-l+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):
ans=0
for i in range(int(input())):
    l,r=map(int,input().split())
    ans+=r+1-l
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 bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
ans = 0
for _ in range(N):
    l, r = M()
    ans += (r-l)+1
print(ans)

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

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

for i in range(n):
  rl[i] = input().split()
  
ans = []

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

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

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):
N = int(input())
total = 0
for i in range(N):
  MM = input().split()
  a = int(MM[0])
  b = int(MM[1])
  total += b-a +1
print(total)

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
else:
    print(ans)

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

Solution (Python):
import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9

def main():
    n = int(input())
    L = []
    R = []
    for _ in range(n):
        l,r = map(int, input().split())
        L.append(l)
        R.append(r)

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


if __name__ == '__main__':
    main()

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

Solution (Python):
s = input()

n = int(s)

answer = 0

for i in range(n):
    p = input().split()
    x = int(p[0])
    y = int(p[1])
    answer += (y - x) + 1

print(answer)

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

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

print(ans)

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

Solution (Python):
n = int(input())
def minus(x):
    return int(x[1])-int(x[0])+1
lr = [minus(input().split()) for i in range(n)]
print(sum(lr))

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):
seat = [0] * 100000
n = int(input())
result = 0
for i in range(n):
    t1,t2 = map(int,input().split())
    if t2 - t1 != 0: result += t2 - t1 + 1
    else: result += 1
print(result)

Solution (Python):
n = int(input())
c = [0]*10**5
for i in range(n):
    a, b = map(int, input().split())
    for j in range(a, b+1):
        c[j-1] = 1
print(sum(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())

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())
c = [False]*(10**5+1)
for i in range(N):
    l, r = map(int, input().split())
    for j in range(l, r+1):
        c[j] = True

print(c.count(True))

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

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

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

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

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 resolve():
    n = int(input())
    lr_list = list()
    for i in range(n):
        a = list(map(int, input().split()))
        lr_list.append(a)

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

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())
a = 0
for i in range(n):
    l, r = map(int, 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 = 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())

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

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())
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):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

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

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

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

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

Solution (Python):
import sys
N = int(input())
array_list = []
for I in range(N):
    array_list.append(list(map(int,input().split())))

if N < 1 or N > 1000:
    sys.exit()

number = 0
for J in array_list:
    number += (J[1] - J[0] + 1)

print(number)

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):
print(sum(1-eval(input().replace(" ","-")) for _ in range(int(input()))))

Solution (Python):
def resolve():
    record =[]
    for i in range(int(input())):
        l,r = map(int,input().split())
        record+=list(range(l,r+1))
    print(len(set(record)))

resolve()

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

Solution (Python):
a = 0

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