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
24 30

-----Sample Output-----
7

There are 7 people, sitting at Seat 24,25,26,27,28,29 and 30.
[{"code": "N = int(input())\nans = 0\nfor _ in range(N):\n  a, b = map(int, input().split())\n  ans += b - a + 1\nprint(ans)", "passed": true, "time": 1.8, "memory": 14164.0, "status": "done"}, {"code": "N = int(input())\nans = 0\nfor _ in range(N):\n    l, r = map(int, input().split())\n    ans += r-l+1\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "a=int(input())\nb=[input().split() for i in range(a)]\nc=0\nfor i in range(a):\n  c=c+(int(b[i][1])-int(b[i][0]))\nprint(c+a)", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "N = int(input())\nseat = 0\nfor i in range(N):\n    l, r = map(int, input().split())\n    seat += r - l + 1\nprint(seat)", "passed": true, "time": 0.3, "memory": 13956.0, "status": "done"}, {"code": "N = int(input())\nres = 0\n\nfor i in range(N):\n    l, r = map(int,input().split())\n    res += r - l + 1\n    \nprint(res)", "passed": true, "time": 0.3, "memory": 14004.0, "status": "done"}, {"code": "n = int(input())\nseat = [0] * (10 ** 5 + 1)\nfor i in range(n):\n    l, r = list(map(int, input().split()))\n    seat[l - 1] += 1\n    seat[r] -= 1\n\nfor i in range(1, 10 ** 5):\n    seat[i] += seat[i - 1]\n\nres = 0\nfor i in range(10 ** 5):\n    if seat[i] == 1:\n        res += 1\nprint(res)\n", "passed": true, "time": 0.18, "memory": 14152.0, "status": "done"}, {"code": "print(sum([r-l+1 for l,r in [list(map(int,input().split())) for _ in range(int(input()))]]))", "passed": true, "time": 0.24, "memory": 14340.0, "status": "done"}, {"code": "N = int(input())\nppl = 0\nfor i in range(N):\n  tmp = input().split(\" \")\n  ppl += int(tmp[1]) - int(tmp[0]) + 1\n\nprint(ppl)", "passed": true, "time": 0.3, "memory": 14216.0, "status": "done"}, {"code": "n = int(input())\nans  = 0\nfor i in range(n):\n    a,b = map(int,input().split())\n    ans += b-a+1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14024.0, "status": "done"}, {"code": "n=int(input())\nans = 0\nfor i in range(n):\n    a,b=(int(x) for x in input().split())\n    c = b-a+1\n    ans += c\n\nprint(ans)", "passed": true, "time": 0.16, "memory": 14320.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor i in range(n):\n    l, r = map(int, input().split())\n    ans += r-l+1\n\nprint(ans)", "passed": true, "time": 0.3, "memory": 14156.0, "status": "done"}, {"code": "N = int(input())\n\ncnt = 0\n\nfor _ in range(N):\n  l, r = map(int,input().split())\n  cnt += r - l + 1\n  \nprint(cnt)", "passed": true, "time": 0.15, "memory": 14156.0, "status": "done"}, {"code": "n = int(input())\nsum = 0\nfor _ in range(n):\n    a, b = map(int, input().split())\n    sum += b-a+1\nprint(sum)", "passed": true, "time": 0.23, "memory": 14188.0, "status": "done"}, {"code": "N=int(input())\nans=0\nfor i in range(N):\n  l,r=map(int,input().split())\n  ans += r-l+1\nprint(ans)", "passed": true, "time": 0.23, "memory": 14152.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor _ in range(n):\n    l,r = list(map(int, input().split()))\n    ans += r - l + 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "def main():\n    n = int(input())\n    ans = 0\n    for _ in range(n):\n        a, b = list(map(int, input().split()))\n        ans += b - a + 1\n    print(ans)\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "n = int(input())\nli = [list(map(int,input().split())) for i in range(n)]\ncnt = 0\nfor i in li:\n    cnt += i[1] - i[0] +1\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14196.0, "status": "done"}, {"code": "n=int(input())\nkei=0\nfor i in range(n):\n    l,r=map(int,input().split())\n    kei += r-l+1\nprint(kei)", "passed": true, "time": 0.24, "memory": 14060.0, "status": "done"}, {"code": "ans=0\nN=int(input())\nfor i in range(N):\n  a,b=map(int,input().split())\n  ans+=b-a+1\nprint(ans)", "passed": true, "time": 0.23, "memory": 14024.0, "status": "done"}, {"code": "N = int(input())\nans = 0\nfor i in range(N):\n    l,r = map(int,input().split())\n    ans += r - l + 1\nprint(str(ans))", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "a=int(input())\nans=0\nfor i in range(a):\n   x,y=map(int,input().split())\n   ans+=y-x+1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "N=int(input())\npeople=0\nfor i in range(N):\n    l,r=list(map(int,input().split()))\n    people+=r-l+1\nprint(people)\n", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n = int(input())\nres = 0\nfor i in range(n):\n    r, l = list(map(int, input().split()))\n    res += l - r + 1\nprint(res)\n", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor i in range(n):\n    a, b = list(map(int, input().split()))\n    ans += b - a + 1\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor i in range(n):\n  l, r = map(int, input().split())\n  ans += (r - l + 1)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "n = int(input())\nlr = [list(map(int, input().split())) for i in range(n)]\nans = 0\nfor i in range(n):\n    ans += (lr[i][1]-lr[i][0]+1)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14064.0, "status": "done"}, {"code": "N = int(input())\np = 0\nfor i in range(N):\n  l, r = map(int,input().split())\n  p += r-l+1\nprint(p)", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "n=int(input())\nans=0\nfor i in range(n):\n  l,r=list(map(int,input().split()))\n  ans+=r-l+1\n\nprint(ans)\n", "passed": true, "time": 0.23, "memory": 14164.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\nn = int(input())\na = [0]*n\nb = [0]*n\nans = 0\n\nfor i in range(n):\n    a[i],b[i] = list(map(int, input().split()))\n\nfor i in range(n):\n    ans += b[i] - a[i] + 1\n\nprint(ans)\n\n", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "n=int(input())\n\ncnt=0\n\nfor i in range(n):\n    l,r = map(int, input().split())\n    cnt += r-l+1\n\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "n = int(input())\nl = [tuple(map(int, input().split())) for i in range(n)]\n\ncnt = 0\nfor i in l:\n    cnt += (i[1] - i[0] + 1)\nprint(cnt)\n", "passed": true, "time": 0.27, "memory": 14288.0, "status": "done"}, {"code": "n=int(input())\nans=0\nfor i in range(n):\n    l,r=list(map(int,input().split()))\n    ans+=r-l+1\nprint(ans)\n", "passed": true, "time": 0.25, "memory": 14216.0, "status": "done"}, {"code": "N = int(input())\nlr = [list(map(int,input().split())) for i in range(N)]\nans = 0\nfor i in lr:\n  ans += i[1] -i[0] + 1\nprint(ans)", "passed": true, "time": 0.28, "memory": 14068.0, "status": "done"}, {"code": "N = int(input())\nans = 0\n\nfor _ in range(N):\n  l, r = map(int, input().split())\n  ans += r - l + 1\n\nprint(ans)", "passed": true, "time": 0.25, "memory": 14264.0, "status": "done"}, {"code": "n=int(input())\nhito=0\nfor i in range(n):\n    l,r=map(int, input().split())\n    hito+=r-l+1\nprint(hito)", "passed": true, "time": 0.23, "memory": 14088.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\ndef main():\n    n = int(input())\n    ans = 0\n    for i in range(n):\n        l, r = list(map(int, input().split()))\n        ans += r - l + 1\n    print(ans)\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.16, "memory": 14116.0, "status": "done"}, {"code": "N=int(input())\nl=[0]*N\nr=[0]*N\nsum=0\nfor i in range(N) :\n  l[i],r[i]=map(int,input().split())\n  sum+=r[i]-l[i]+1\nprint(sum)", "passed": true, "time": 0.24, "memory": 14172.0, "status": "done"}, {"code": "# coding = SJIS\n\nn = int(input())\nmen = []\nfor i in range(n):\n    l, r = map(int, input().split())\n    men.append([l, r])\nans = 0\n\nfor i in range(n):\n    ans += men[i][1] - men[i][0] + 1\n\nprint(ans)", "passed": true, "time": 0.16, "memory": 14072.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor i in range(n):\n    l,r = map(int,input().split())\n    ans += (r-l+1)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14156.0, "status": "done"}, {"code": "N = int(input())\nsum = 0\nfor i in range(N):\n  l, r = map(int, input().split())\n  sum += (r-l) + 1\n  \nprint(sum)", "passed": true, "time": 0.15, "memory": 14152.0, "status": "done"}, {"code": "# \u5165\u529b\nN=int(input())\n\nsm=0\n\nfor i in range(N):\n  l,r=map(int,input().split())\n  sm+=r-l+1\n\n# \u51fa\u529b\nprint(sm)", "passed": true, "time": 0.16, "memory": 14296.0, "status": "done"}, {"code": "n = int(input())\np = 0\nfor i in range(n):\n  l, r = map(int, input().split())\n  p += r-l+1\n \nprint(p)", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "#https://atcoder.jp/contests/abc073/tasks/abc073_b\nN = int(input())\nans = 0\nfor i in range(N):\n    st,sp = map(int,input().split())\n    ans += abs(sp-st+1)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14164.0, "status": "done"}, {"code": "N = int(input())\ns = 0\nfor _ in range(N):\n    a, b = map(int, input().split())\n    s += b - a + 1\nprint(s)", "passed": true, "time": 0.15, "memory": 14160.0, "status": "done"}, {"code": "N = int(input())\nans = 0\nfor _ in range(N):\n  l,r = map(int,input().split())\n  ans += r - l + 1\n  \nprint(ans)", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "n = int(input())\ntotal = 0\nfor i in range(n):\n    l, r = map(int,input().split())\n    total += r - l + 1\nprint(total)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "N = int(input())\nans =  0\n\nfor i in range(N):\n    l,r = list(map(int, input().split()))\n    ans += r - l + 1\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "#k = int(input())\n#s = input()\n#a, b = map(int, input().split())\n#s, t = map(str, input().split())\n#l = list(map(int, input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\n#a = [list(input()) for _ in range(n)]\n#a = [int(input()) for _ in range(n)]\n\n\nn = int(input())\n\nans = 0\n\nfor i in range(n):\n    l, r = list(map(int, input().split()))\n    ans += r - l + 1\nprint(ans)\n", "passed": true, "time": 0.13, "memory": 14176.0, "status": "done"}, {"code": "n = int(input())\nA = [tuple(map(int, input().split())) for _ in range(n)]\n\nans = 0\nfor l, r in A:\n    ans += r - l + 1\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "# ABC073\nN = int(input())\nL_R = [list(map(int, input().split())) for _ in range(N)]\nans = 0\nfor l, r in L_R:\n    ans += r - l + 1\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14088.0, "status": "done"}, {"code": "n = int(input())\n\nnum = 0\n\nfor i in range(n):\n    l,r = map(int,input().split())\n    num += (r - l + 1)\n    \nprint(num)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "IS = lambda: int(input())\nIA = lambda: [int(x) for x in input().split()]\nIM = lambda N: [IA() for _ in range(N)]\n\nans = 0\nfor l,r in IM(IS()):\n    ans += r - l + 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "def mapt(fn, *args):\n    return tuple(map(fn, *args))\n\n\ndef Input():\n    return mapt(int, input().split(\" \"))\n\n\ndef main():\n    n = int(input())\n    data =[Input() for _ in range(n)]\n    ans = 0\n    for start, end in data:\n        for _ in range(start, end+1):\n            ans += 1\n    print(ans)\n\n\nmain()", "passed": true, "time": 0.31, "memory": 13968.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor i in range(n):\n  l,r = map(int,input().split())\n  ans += r+1-l\nprint(ans)", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "N = int(input())\nans = 0\nfor i in range(N):\n    l, r = list(map(int, input().split()))\n    ans += r-l+1\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "n = int(input())\ndata = [input().split() for i in range(n)]\nans = 0\nfor i in range(n):\n    ans += int(data[i][1]) - int(data[i][0]) + 1\nprint(ans)", "passed": true, "time": 0.3, "memory": 13980.0, "status": "done"}, {"code": "n=int(input())\nans=0\nfor i in range(n):\n    l,r=list(map(int,input().split()))\n    ans+=r-l+1\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "n = int(input())\nnum = 0\nfor i in range(n):\n    l, r = map(int, input().split())\n    num += (r - l) + 1\nprint(num)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "n = int(input())\nflg = [0]*100000\nfor _ in range(n):\n    l,r = list(map(int,input().split()))\n    for i in range(l,r+1):\n        flg[i-1] = 1\nprint((flg.count(1)))\n", "passed": true, "time": 0.24, "memory": 14104.0, "status": "done"}, {"code": "N = int(input())\n\nans = 0\n\nfor i in range(N):\n   L = input().split()\n   ans += int(L[1]) - int(L[0]) + 1\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14028.0, "status": "done"}, {"code": "n = int(input())\ntmp = 0\nnum_person = []\nfor _ in range(n):\n    l, r = map(int, input().split())\n    tmp =  r-l+1\n    num_person.append(tmp)\n\nans = 0\nfor i in num_person:\n    ans += i\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14240.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor i in range(n):\n  l, r = map(int, input().split())\n  ans += r - l + 1\nprint(ans)", "passed": true, "time": 0.15, "memory": 14240.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor i in range(n):\n    l, r = map(int, input().split())\n    ans += r - l + 1\nprint(ans)", "passed": true, "time": 0.24, "memory": 13996.0, "status": "done"}, {"code": "n = int(input())\nseat = [0] * 10 ** 6\nfor i in range(n):\n    l, r = list(map(int, input().split()))\n    for j in range(l, r + 1):\n        seat[j - 1] = 1\n\nres = 0\nfor i in range(10 ** 6):\n    if seat[i] == 1:\n        res += 1\nprint(res)\n", "passed": true, "time": 0.4, "memory": 21180.0, "status": "done"}, {"code": "N = int(input())\nres = 0\nfor _ in range(N):\n    l, r = list(map(int, input().split()))\n    res += r - l + 1\n\nprint(res)\n", "passed": true, "time": 0.15, "memory": 14276.0, "status": "done"}, {"code": "n=int(input())\ncount=0\nfor _ in range(n):\n  l,r=map(int,input().split())\n  count+=r-l+1\nprint(count)", "passed": true, "time": 0.16, "memory": 14200.0, "status": "done"}, {"code": "N = int(input())\na = 0\nfor i in range(N):\n  line = list(map(int,input().split()))\n  a +=(line[-1]-line[0]+1)\nprint(a)", "passed": true, "time": 0.15, "memory": 14032.0, "status": "done"}, {"code": "N = int(input())\nans = 0\nfor _ in range(N):\n  l,r = map(int,input().split())\n  ans += (r-l)+1\nprint(ans)", "passed": true, "time": 0.24, "memory": 14292.0, "status": "done"}, {"code": "n = int(input())\na = 0\nfor _ in range(n):\n    l, r = map(int, input().split())\n    a += r - l + 1\nprint(a)", "passed": true, "time": 0.24, "memory": 14080.0, "status": "done"}, {"code": "N=int(input())\nans=0\nfor i in range(N):\n  l,r=map(int,input().split())\n  ans += r-l+1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "n =int(input())\n\ntotal = 0\nfor i in range(n):\n    a = list(map(int, input().split()))\n    total += a[1] - a[0] + 1\n\nprint(total)", "passed": true, "time": 0.23, "memory": 14048.0, "status": "done"}, {"code": "N=int(input())\nans=0\nfor i in range(N):\n    L,R=map(int,input().split())\n    ans+=R-L+1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14028.0, "status": "done"}, {"code": "n = int(input())\nres = 0\nfor i in range(n):\n  l, r = map(int, input().split())\n  res += r - l + 1\nprint(res)", "passed": true, "time": 0.15, "memory": 14296.0, "status": "done"}, {"code": "N=int(input())\nans=0\nfor _ in range(N):\n  l, r=map(int, input().split())\n  ans+=r-l+1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "N = int (input ())\nx = 0\nfor i in range (N):\n  s,g = map (int, input ().split ())\n  le = g-s+1\n  x += le\nprint (x)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "n = int(input())\ncnt = 0\nfor i in range(n):\n  l, r = [int(x) for x in input().split()]\n  cnt+=r-l+1\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor _ in range(n):\n    l,r = map(int,input().split())\n    ans += r-l\nprint(ans+n)", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "n = int(input())\nl = [0] * n\nr = [0] * n\nfor i in range(n):\n    l[i],r[i] = map(int, input().split())\nres = 0\n\nfor i in range(n):\n  res += r[i]-l[i]+1\n\nprint(res)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "N = int(input())\nans = 0\nfor _ in range(N):\n    l, r = (int(x) for x in input().split())\n    ans += r-l+1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "a=int(input())\nx = \"\"\ny = 0\nfor i in range(a):\n    x=input().split()\n    y+=abs(int(x[0])-int(x[1]))+1\nprint(y)", "passed": true, "time": 0.14, "memory": 14040.0, "status": "done"}, {"code": "N=int(input())\nprint(sum(r-l+1 for l,r in (map(int,input().split()) for _ in range(N))))", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "from typing import List\n\n\ndef answer(n: int, lrs: List[List[int]]) -> int:\n    number_of_people_sitting = 0\n    for lr in lrs:\n        l, r = lr\n        number_of_people_sitting += r - l + 1\n\n    return number_of_people_sitting\n\n\ndef main():\n    n = int(input())\n    lrs = [map(int, input().split()) for _ in range(n)]\n    print(answer(n, lrs))\n\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.15, "memory": 15156.0, "status": "done"}, {"code": "n = int(input())\nc = 0\nfor i in range(n):\n  l,r = map(int, input().split())\n  c += r-l+1\nprint(c)", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "N=int(input())\nans=0\nfor _ in range(N):\n    l,r=list(map(int,input().split()))\n    ans+=r-l+1\nprint(ans)\n", "passed": true, "time": 0.23, "memory": 14264.0, "status": "done"}, {"code": "N = int(input())\n\nans = 0\n\nfor _ in range(N):\n    l,r = map(int, input().split())\n    ans += r - l + 1\n\nprint(ans)", "passed": true, "time": 0.57, "memory": 14244.0, "status": "done"}, {"code": "n = int(input())\nnum = 0\nfor i in range(n):\n    l,r = map(int, input().split())\n    num += (r-l+1)\nprint(num)", "passed": true, "time": 0.22, "memory": 14152.0, "status": "done"}, {"code": "N = int(input())\nl = [0] * N\nr = [0] * N\nfor i in range(N):\n    l[i], r[i] = list(map(int, input().split()))\n\nans = 0\nfor i in range(N):\n    ans += r[i] - (l[i] - 1)\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "n=int(input())\nlr=[list(map(int,input().split())) for i in range(n)]\nans=0\nfor i in range(n):\n  ans+=(lr[i][1]-lr[i][0]+1)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "#\n# abc073 b\n#\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n    def assertIO(self, input, output):\n        stdout, stdin = sys.stdout, sys.stdin\n        sys.stdout, sys.stdin = StringIO(), StringIO(input)\n        resolve()\n        sys.stdout.seek(0)\n        out = sys.stdout.read()[:-1]\n        sys.stdout, sys.stdin = stdout, stdin\n        self.assertEqual(out, output)\n\n    def test_\u5165\u529b\u4f8b_1(self):\n        input = \"\"\"1\n24 30\"\"\"\n        output = \"\"\"7\"\"\"\n        self.assertIO(input, output)\n\n    def test_\u5165\u529b\u4f8b_2(self):\n        input = \"\"\"2\n6 8\n3 3\"\"\"\n        output = \"\"\"4\"\"\"\n        self.assertIO(input, output)\n\n\ndef resolve():\n    N = int(input())\n    LR = [list(map(int, input().split())) for _ in range(N)]\n\n    ans = 0\n    for lr in LR:\n        l, r = lr\n        ans += r - l + 1\n\n    print(ans)\n\n\ndef __starting_point():\n    # unittest.main()\n    resolve()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14388.0, "status": "done"}, {"code": "n = int(input())\n# seat = [0] * 10 ** 6\nseat = [0] * 10 ** 5\nfor i in range(n):\n    l, r = list(map(int, input().split()))\n    for j in range(l, r + 1):\n        seat[j - 1] = 1\n\nres = 0\n# for i in range(10 ** 6):\nfor i in range(10 ** 5):\n    if seat[i] == 1:\n        res += 1\nprint(res)\n", "passed": true, "time": 0.16, "memory": 14280.0, "status": "done"}, {"code": "N = int(input())\ncnt = 0\nfor _ in range(N):\n    l, r = map(int, input().split())\n    cnt += r - l + 1\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor i in range(n):\n  a, b = map(int, input().split())\n  ans += (b - a + 1)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "n = int(input())\n#a, b = map(int,input().split())\n#l = list(map(int,input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\nans = 0\nfor i in range(n):\n    l, r = list(map(int, input().split()))\n    ans += r-l+1\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "N = int(input())\nsum = 0\nfor i in range(N):\n  l, r = map(int, input().split())\n  sum += r - l + 1\nprint(sum)", "passed": true, "time": 0.14, "memory": 14020.0, "status": "done"}, {"code": "n = int(input())\nres = 0\nfor i in range(n):\n  a = [int(x) for x in input().split()]\n  res += a[1] - a[0] + 1\nprint(res)", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}]