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

print(seats)

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

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

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


def main():
    n = int(input())
    seat_list = []
    for _ in range(n):
        seat_list.append(list(map(int, input().split())))
    ans = 0

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

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

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

Solution (Python):
n = int(input())
l_r = [[int(m) for m in input().split(" ")] for i in range(n)]

print(sum([r_i-l_i for l_i, r_i in l_r]) + n)

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

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

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

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

Solution (Python):
import sys

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

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

print(s)

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

print(count)

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

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

print(total)

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

for x in range(a):
    b ,c = map(int,input().split())
    d += c-b+1
print(d)

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

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

Solution (Python):
"""
https://abc073.contest.atcoder.jp/tasks/abc073_b
"""
n=int(input())
a=0
lr=[]
for i in range(n):
    lr.append([j for j in input().split()])


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

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

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

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

Solution (Python):
N = int(input())
a = []
tmp = []
for i in range(N):
    tmp = [int(i) for i in input().split()]
    a.append(tmp)

res = 0
for i in a:
    if i[1] - i[0] == 0:
        res += 1
    else:
        res += i[1] - i[0] + 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())
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):
  f,t = map(int,raw_input().split())
  ans += (t - (f -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())
total = 0

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

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

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

Solution (Python):


n = int(input())
A = [list(map(int, input().split())) for _ 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())
a = []
for i in range(N):
    a.append(list(map(int, input().split())))

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

print(cnt)

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

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

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

res = 0

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

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

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

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

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

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

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

print(num)

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

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

G=[None]*N

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

P=0

for i in range(N):
    P+=G[i][1]-G[i][0]+1

print(P)

Solution (Python):
N = int(input())
seatingPlaces = []
sum_number_of_people = 0

for i in range(N):
    seatingPlaces.append(list(map(int, input().split())))

for onegroup in seatingPlaces:
    number_of_people = onegroup[1] - onegroup[0] + 1
    sum_number_of_people += number_of_people

print(sum_number_of_people)

Solution (Python):
num = int(input())
InA = [input().split() for i in range(num)]
seki_total = 0

for seki in InA:
    seki_total += int(seki[1]) - int(seki[0]) + 1

print (seki_total)

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

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


for i in range(dantaisuu):
    a, b = [int(i) for i in input().split()]
    ninnzuu = b - a + 1
    total += ninnzuu


print(total)

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

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

i = 0
cnt = 0

for i in range(N):
    a, b = (int(j) for j in input().split())
    cnt = cnt + (b - a + 1)

print(cnt)

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

char = []
seats = 0
for i in range(N):
    l,r = (int(j) for j in input().split())
    seats = seats + (r-l+1)

print(seats)

Solution (Python):
print(sum((lambda a,b:int(b)-int(a)+1)(*input().split())for _ in[0]*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):
kumisu=int(input())
kyaku=0
for i in range(kumisu):
    y1,y2=map(int,input().split())
    kyaku +=y2-y1+1
print(kyaku)

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

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

groups = []
for i in range(N):
    x, y = map(int, input().split())
    groups.append([x, y])

count = 0
for v in groups:
    count += v[1] - v[0] + 1

print(count)

Solution (Python):
N = input('')
groups = []
for x in range(int(N)):
  groups.append((input('')).split())
count = 0
for g in groups:
  count += (int(g[1]) - int(g[0]) + 1)
print(count)

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

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

print ans

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

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

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

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

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

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

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

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

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

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

print(cus)

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



def get_next_int():
    return int(float(input()))


def get_next_ints(delim=" "):
    return tuple([int(float(x)) for x in input().split(delim)])


def get_next_str():
    return input()


def get_next_strs(delim=" "):
    return tuple(input().split(delim))


def get_next_by_types(*value_types, delim=" "):
    return tuple([t(x) for t, x in zip(value_types, input().split(delim))])


def solve():
    N = get_next_int()
    ans = 0
    for i in range(N):
        l, r = get_next_ints()
        ans += r-l+1
    print(ans)
solve()

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):
groups = [list(map(int, input().split())) for _ in range(int(input()))]
print(sum(map(lambda x: x[1] - x[0] + 1 , groups)))

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()

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

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

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

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

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

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

sum = 0
for _ in range(loops):
    left, right = map(int, input().split())
    sum += (right - left + 1)
print(sum)

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

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

Solution (Python):
import math
import sys

def getinputdata():

    
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

n = int(arr_data[0][0])

mysum=0

for v in range(1,1+n):


    mysum+= int(arr_data[v][1])-int(arr_data[v][0])+1


print(mysum)

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

Solution (Python):

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

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

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())
a = []
x = 0

for i in range(n):
    a.append(list(map(int,input().split())))

for b in range(n):
    x += a[b][-1] - a[b][0] + 1

print(x)

Solution (Python):
s=0
for _ in[0]*int(input()):
    a,b=map(int,input().split());s+=b-a+1
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):





if __name__ == '__main__':
    group_count = int(input())

    seated_numbers = [list(map(int, input().split())) for _ in range(group_count)]
    total_person = 0

    for line in seated_numbers:
        total_person += max(line) - min(line) + 1

    print(total_person)

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


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

print(sum(audience))

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

for _ in range(N):
    l, r = map(int, raw_input().split())
    ans += r-l+1

print ans

Solution (Python):


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

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(10000)


def chkprint(*args):
    names = {id(v):k for k,v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))


def to_bin(x):
    return bin(x)[2:]


def dim2input(N):
    li = []
    for _ in range(N):
        li.append(input().split())
    return li



dp = None

def main():
    seats = 0
    N = int(input())

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

    print(seats)


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

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):
a = raw_input()

people = 0
for i in range(int(a)):
  number_list = raw_input().split()
  people += int(number_list[1])-int(number_list[0]) +1
  
print(people)

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

M = 0
for n in range(N):
    l, r = [int(n) for n in input().split()]
    m = r - l + 1
    M += m

print(M)

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

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

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

print(t)

Solution (Python):
n = int(input())
x = [[int(i) for i in input().split()] for i in range(n)]
ans = 0;

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

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

xs = [tuple(map(int, input().split())) for i in range(n)]

print(sum([r - l + 1 for l, r in xs]))

Solution (Python):
att = 0
num = raw_input()
for i in range(int(num)):
    ppl = raw_input().split()
    att += 1 + (int(ppl[1])-int(ppl[0]))
print att

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):
first = int(raw_input())
k = [map(int, raw_input().split()) for i in range(first)]
audience = 0
for i in range(len(k)):
    audience = audience + k[i][1] - k[i][0] + 1

print audience

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

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

Solution (Python):

res = 0

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

Solution (Python):
n=int(input())
l=[]
for i in range(n):
    li,ri=map(int, input().split())
    l.append(ri-li+1)

print(sum(l))

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

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

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

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

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

c=0
for i in range(a):
    b=input().split()

    d=int(b[0])
    f=int(b[1])

    g=f-d+1
    c=g+c

print(c)

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

Solution (Python):
N=int(input());total = 0
for i in range(0,N):
    row = input().split()
    total = total + int(row[1])-int(row[0])+1
print(total)

Solution (Python):

"""
Created on Tue Dec 19 09:36:44 2017

@author: kotania
"""

N = int(input())
lrList = [""]*N
for n in range(0,N):
    lrList[n] = input()

sum = 0
for lr in lrList:
    sum += (int(lr.split()[1]) - int(lr.split()[0]) + 1)
    
print(sum)

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

val = 0
for num in range(0,N):
    row = input().split()
    val = val + int(row[1]) - int(row[0])

val = val + N
print(val)

Solution (Python):


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

count = 0
for i in li:
    count += i[1] - i[0] + 1

print(count)

Solution (Python):
num =int(input())
res = 0
for i in range(num):
    val = [int(x) for x in input().split()]
    res += (val[1]-val[0]+1)
print(res)

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

Ans = 0

for i in range(n):
	Ans += e[i][1] - e[i][0] + 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())
P = [list(map(int,input().split())) for _ in range(N)]
ans = 0
for i in range(N):
    ans += P[i][1] - P[i][0] + 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())
total = 0
for i in range(n):
    seats = [int(j) for j in input().split()]
    total = total + seats[1] - seats[0] + 1
print(total)

Solution (Python):


N=input()
sum=0
a = []
for i in range(N):
    a.append(map(int, raw_input().split()))

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

print sum

Solution (Python):
if __name__ == "__main__":
    N = int(input())
    res = 0
    for x in range(N):
        a,b = map(int, input().split())
        res += b - a + 1
    print (res)

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

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

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

print(s)

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

seat_sum=0
for i in range(N):
    li,ri=[int(i) for i in input().split()]
    seat_sum+=(ri-li+1)

print(seat_sum)

Solution (Python):


def main():
    N = int(input())

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

if __name__ == '__main__':
    main()

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

Solution (Python):
N = int(raw_input())
sum = 0
for i in xrange(N):
	s,e = map( int,raw_input().split() )
	sum += e-s+1
print sum

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

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

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

Solution (Python):
n = input()
a = [0] * 100010
for i in xrange(n):
	l, r = [int(x) for x in raw_input().split()]
	a[l:r + 1] = [1] * (r - l + 1)
print a.count(1)

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

Solution (Python):
def countNum(num):
	count = 0
	for x in range(0,num):
		count += int(inputSeats[x][1]) - int(inputSeats[x][0]) + 1		
	return count

inputSeats = [[]]
if __name__ == '__main__':
	inputNum = int(input())
	

	for x in range(0,inputNum):
		inputSeat = input()
		inputSeats.append(inputSeat.split())
		

	inputSeats.pop(0)
	print(countNum(inputNum))

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 = []
R = []
for i in range(N):
    l, r = list(map(int, input().split()))
    L.append(l)
    R.append(r)
total = 0
for i in range(N):
    total += R[i] - L[i] + 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(raw_input())
ans = 0
for i in xrange(N):
    l, r = map(int, raw_input().split())
    ans += r - l + 1
print ans

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
 
sys.setrecursionlimit(10**7)
inf = 10**20
gosa = 1.0 / 10**10
mod = 10**9+7
 
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 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 I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
 
 
def main():
    n = I()
    r = 0
    for _ in range(n):
        a,b = LI()
        r += b-a+1
 
    return r
 
print(main())

Solution (Python):


n = int(input())

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

print(t)

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

for i in range(N):
    se = input().split()   
    ans += (int(se[1])-int(se[0])+1)
    
print(ans)

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

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

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

print(ans)

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

count =0
for _ in range(n):

    x, y = [int(x) for x in input().split()]

    count += y-x+1

print(count)

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

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

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

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

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

print(s)

Solution (Python):
N=int(input())
n=[[]]
ans=0

for i in range(N):
    n.append(input().split())

for j in range(1,N+1):
    
    ans+=int(n[j][1])-int(n[j][0])
    ans+=1

print(ans)

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

seats = []

for i in range(N):
    inputs = input().split()
    seats.append([int(inputs[0]), int(inputs[1])])

ans = 0
for i in seats:
    ans += i[1] - i[0] + 1

print(ans)

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

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

print(s)

Solution (Python):


seat = [0] * 100000
n = input()
for _ in xrange(n):
    l, r = map(int, raw_input().split())
    for j in xrange(l-1, r):
        seat[j] = 1

print seat.count(1)

Solution (Python):
if __name__ == '__main__':
    N = int(input())
    ans = 0
    for i in range(N):
        l = list(map(int, input().split()))
        ans += abs(l[1]-l[0]+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):
def solve():
    n = int(input())
    ans = 0
    for _ in range(n):
        x, y = map(int, input().split(" "))
        ans += (y - x + 1)
    print(ans)

if __name__ == '__main__':
    solve()

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

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

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

for seat in seats:
    sum += seat[1] - seat[0]

print(sum)

Solution (Python):
def B_Theater():
    groups = []
    try:
        LOCAL_FLAG
        
        
        N = 2
        groups = [[6, 8], [3, 3]]
    except NameError:
        N = int(input())
        for i in range(N):
            groups.append(list(map(int, input().split())))

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

B_Theater()

Solution (Python):
N = int(raw_input())
temp = 0
for i in range(0,N):
 a = raw_input().split(" ")
 temp += int(a[1]) - int(a[0])+1
print temp