peterverebics/CodeNet_Python_118 huggingface dataset:
from collections import deque

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

p = deque()

for i in list:
  p.append([i[0] - i[1],i[0] + i[1]])
  
p = sorted(p,key = lambda x: x[1])

ex = []
ex.append(p.pop(0))




for i in range(len(p)):
  if(ex[-1][1] <= p[0][0]):
    ex.append(p.pop(0))
  else:
    p.pop(0)

print(len(ex))
N = int(input())
X_L = [[0] * 2 for i in range(N)]
for i in range(N):
    X, L = map(int, input().split())
    X_L[i][0] = X - L
    X_L[i][1] = X + L

X_L = sorted(X_L, key=lambda x:x[1],reverse=False)
#X_L = sorted(X_L, key=lambda x:x[0],reverse=False)

#print(X_L)

right = X_L[0][1]
Sum = 1

for i in range(1,N):
    if right <= X_L[i][0]:
        Sum += 1
        right = X_L[i][1]

print(Sum)
n = int(input())
xl = [list(map(int, input().split())) for i in range(n)]
st = [[xl[i][0] + xl[i][1], xl[i][0] - xl[i][1]] for i in range(n)]
st.sort()
ans = 1
t = st[0][0]
for i in range(1, n):
  if st[i][1] >= t:
    ans += 1
    t = st[i][0]
print(ans)
n = int(input())
ranges = []
for _ in range(n):
    xi, li = map(int, input().split())
    ranges.append((xi - li, xi + li))
ranges = sorted(ranges, key=lambda x: x[1])


ans = 0
cur = -int(1e18)
for i in range(n):
    if cur <= ranges[i][0]:
        ans += 1
        cur = ranges[i][1]

print(ans)
N = int(input())
XL = [tuple(map(int, input().split())) for _ in range(N)]
XL.sort(key=lambda x: x[0]+x[1])
cnt = 0
now = 10 ** 9 * -1
for x, l in XL:
    if now <= x - l:
        cnt += 1
        now = x + l

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

XL.sort(key = lambda x:sum(x))
ans = 0
f = -1000000001
for x,l in XL:
    if x - l >= f:
        ans += 1
        #print(f)
        f = x + l
print(ans)
#設定
import sys
input = sys.stdin.buffer.readline

#ライブラリインポート
from collections import defaultdict

#入力受け取り
def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N = int(input())
	S = []
	for i in range(N):
		X, L = getlist()
		S.append([X + L, X - L])
	S = sorted(S)
	# print(S)
	ans = 1
	val = S[0][0]
	for i in range(1, N):
		if S[i][1] >= val:
			ans += 1
			val = S[i][0]
	print(ans)
	


if __name__ == '__main__':
	main()
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    A = []
    for _ in range(int(input())):
        x, l = map(int, input().split())
        A.append((x - l, x + l))

    A.sort(key = lambda x : x[1])
    ans = 0
    now = -INF
    for l, r in A:
        if now <= l:
            now = r
            ans += 1
    print(ans)
resolve()
# coding: utf-8
N = int(input())
ans = 1

robot_list = []
for i in range(N):
    x, l = map(int,input().split())
    s = x - l
    t = x + l
    robot_list.append([s, t])

robot_list.sort(key=lambda x:x[1])
#print(robot_list)
c = robot_list[0][1]

for i in range(1,N):
    if robot_list[i][0] >= c:
        ans += 1
        c = robot_list[i][1]
print(ans)
import sys
input = sys.stdin.readline
N = int(input())
a = []
x = -float("inf")
res = 0
for _ in range(N):
  x, l = map(int, input().split())
  a.append((x - l, x + l))
a.sort(key = lambda x: x[1])
x = -float("inf")
#print(a)
for i in range(N):
  if x <= a[i][0]:
    x = a[i][1]
    res += 1
print(res)
N = int(input())
XL = [tuple(map(int, input().split())) for i in range(N)]
XL.sort(key=lambda x: x[0]+x[1])

right = -10**9
removed = 0
for x, l in XL:
    if x-l < right:
        removed += 1
    else:
        right = x+l
print(N-removed)
n = int(input())
lrl = []

for _ in range(n):
    x,l = map(int,input().split())
    lrl.append((x-l, x+l))


lrl = sorted(lrl, key=lambda x:x[1])
ans = 0
now = -float("inf")

for l,r in lrl:
    if now <= l:
        ans += 1
        now = r

print(ans)
n=int(input())
L=[]
for i in range(n):
    x,l=map(int,input().split())
    L.append([x-l,x+l])
L.sort(key=lambda x:x[1])

ans=1
border=L[0][1]

for i,j in enumerate(L[1:]):
    if border<=j[0]:
        ans+=1
        border=j[1]
print(ans)
from operator import itemgetter
n = int(input())
lst1 = []
for i in range(n):
    x,l = map(int,input().split())
    lst1.append([x-l,x+l])

lst1.sort(key=itemgetter(1)) #終点についてソート

ans = 1
start = lst1[0][1]

for i in range(1,n):
    if lst1[i][0] >= start:
        start = lst1[i][1]
        ans += 1

print(ans)
N = int(input())
X = []
L = []
for i in range(N) :
    p, q = map(int,input().split())
    X.append(p)
    L.append(q)

Arm = []
for i in range(N) :
    Arm.append([X[i]-L[i], X[i]+L[i]])

Arm.sort(key=lambda x:x[1])
ans = 0
mxa = -10**10
for a in Arm :
    if a[0] >= mxa :
        mxa = a[1]
        ans += 1

print(ans)
N = int(input())
L = []

for _ in range(N):
	a, b = map(int, input().split())
	L.append((a-b, a+b))

L = sorted(L, key = lambda x:x[1])
start = L[0][1]
ans = 1

for i in range(1, N):
	if start <= L[i][0]:
		ans += 1
		start = L[i][1]
print(ans)
import sys
readline = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
 

N = int(readline())
XL = map(int, read().split())
 
LR = sorted(
    [(x - l, x + l) for x, l in zip(XL, XL)],
    key=lambda x: x[1])
LR = [(-3 * 10 ** 9, -3 * 10 ** 9)] + LR
 

i = 1
while True:
    if len(LR) <= i:
        break
 
    _, pr = LR[i - 1]
    cl, cr = LR[i]
 
    if pr <= cl:
        i += 1
    else:
        del LR[i]

print(len(LR) - 1)
# coding: utf-8


def solve(*args: str) -> str:
    n = str(args[0])

    RL = []
    for xl in args[1:]:
        x, l = map(int, xl.split())
        RL.append((x+l, x-l))

    RL.sort()

    count = 1
    cur, _ = RL[0]
    for r, l in RL[1:]:
        if cur <= l:
            cur = r
            count += 1

    return str(count)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))
import sys
readline=sys.stdin.readline
read=sys.stdin.read

n=int(readline())
m=map(int,read().split())
robots=list(zip(m,m))
lr=[[i-j,i+j] for i,j in robots]
lr.sort(key=lambda x:x[1])
prep=lr[0][1]
res=1
for l,r in lr[1:]:
  if l>=prep:
    res+=1
    prep=r
print(res)
n = int(input())
a = [list(map(int,input().split())) for i in range(n)]
a = [[a[i][0]-a[i][1],a[i][0]+a[i][1]] for i in range(n)]
a.sort(key = lambda x:x[1])
ans = 1
g = a[0][1]
for i in range(1,n):
  x = a[i][0]
  if g<=x:
    ans += 1
    g = a[i][1]
print(ans)
import sys
input = sys.stdin.readline
from operator import itemgetter

N=int(input())
R=[tuple(map(int,input().split())) for i in range(N)]
R2=[(x-y,x+y) for x,y in R]
R2.sort(key=itemgetter(1))

ANS=0
MAX=-1<<31

for l,r in R2:
    if l<MAX:
        ANS+=1
    else:
        MAX=max(MAX,r)

print(N-ANS)
import heapq
n=int(input())
rb = []
heapq.heapify(rb)
for i in range(n):
    x,l= map(int,input().split())
    heapq.heappush(rb,(x+l,x-l))
ans=0
mostr=-1
while len(rb)>0:
    c=heapq.heappop(rb)
    if ans==0:
        ans+=1
        mostr=c[0]
    else:
        if mostr<=c[1]:
            ans+=1
            mostr=c[0]
print(ans)
N = int(input())

robots = []
for _ in range(N):
    robots.append(tuple(map(int, input().split())))
robots.sort(key=lambda x: x[0] + x[1])

ans = 0
tmp = -float('inf')
for x, l in robots:
    if tmp <= x - l:
        ans += 1
        tmp = x + l
print(ans)
N = int(input())
rob = [] 

for i in range(N):
    x, l = map(int,input().split())
    t = x + l
    rob.append((t,x,l))

rob.sort()
Max = -float("inf")
ans = 0
for i in range(len(rob)): 
    t = rob[i][0]
    x = rob[i][1]
    l = rob[i][2]
    if x-l < Max:
        continue
    else:
        ans += 1
        Max = t
print(ans)
N=int(input())
Robot=[]
for i in range(N):
    x,l = map(int,input().split())
    Robot.append([x-l,x+l])

Robot.sort(key=lambda x: x[1])

ans = 1
ac_max = Robot[0][1]
for i in range(1,N):
    if ac_max <= Robot[i][0]:
        ans += 1
        ac_max = Robot[i][1]

print(ans)
n=int(input())
li = []
for i in range(n):
    x,l=map(int,input().split())
    li.append([x-l,x+l])
li.sort(key = lambda x:x[1])
ans = 1
r = li[0][1]
for i in range(1,n):
    if r <= li[i][0]:
        ans += 1
        r = li[i][1]
print(ans)
N = int(input())
XL = [list(map(int, input().split())) for _ in range(N)]

XLreach = []
for x, l in XL:
  XLreach.append((x+l,x,l))
  
XLreach.sort()

rmv = 0
reach = - 10 ** 12
for r, x, l in XLreach:
  if x - l < reach:
    rmv += 1
  else:
    reach = r
    
print(N - rmv)
N = int(input())
XL = [list(map(int, input().split())) for _ in range(N)]

t = [(x + l, x - l) for x, l in XL]
t.sort()
max_r = -float('inf')
result = 0
for i in range(N):
    r, l = t[i]
    if max_r <= l:
        result += 1
        max_r = r
print(result)
N=int(input())
ans=1
R=[[0]*2 for _ in range(N)]
flag=0
for i in range(N):
    X,L=map(int,input().split())
    R[i][0]=X-L
    R[i][1]=X+L
R.sort(key = lambda x: x[1])
r=R[0][1]
for i in range(1,N):
    if r<=R[i][0]:
        ans+=1
        r=R[i][1]
print(ans)
#pdf見た
n = int(input())
xl = [list(map(int,input().split())) for i in range(n)]
sf = []
choice = -1e+9
for x,l in xl:
    sf.append([x-l,x+l])
sf.sort(key=lambda x:x[1])
cnt = 0
for s,f in sf:
    if choice <= s:
        cnt += 1
        choice = f
        
print(cnt)
N = int(input())
ls = []
for _ in range(N):
    x, l = map(int, input().split())
    ls.append([x-l, x+l])
ls = sorted(ls, key= lambda x: x[1])

ans = N
for i in range(1, N):
    if ls[i-1][1] > ls[i][0]:
        ls[i][1] = ls[i-1][1]
        ans -= 1
print(ans)
from operator import itemgetter

N = int(input())
R = [0]*N
for i in range(N):
    X_i, L_i = map(int, input().split())
    R[i] = (X_i-L_i,X_i+L_i)
R.sort(key=itemgetter(1))

ans, loc = 0, -(float('inf'))
for i in range(len(R)):
    if loc <= R[i][0]:
        ans += 1
        loc = R[i][1]
print(ans)
N = int(input())
XL = []
for _ in range(N):
    XL.append(tuple(map(int, input().split())))

for i in range(N):
    X, L = XL[i]
    XL[i] = (X-L, X+L)
#print(XL)

XL.sort(key = lambda x:x[1])
#print(XL)

right = XL[0][1]
cnt = 1
for i in range(1, N):
    if right <= XL[i][0]:
        right = XL[i][1]
        cnt += 1
print(cnt)
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
lr = [None]*n
for i in range(n):
    x,l = map(int, input().split())
    lr[i] = (x-l, x+l)
lr.sort(key=lambda x: x[1])
ans = 0
c = -10**10
for l,r in lr:
    if c<=l:
        ans += 1
        c = r
print(ans)
N = int(input())
sch = []
for _ in range(N):
    x, l = map(int, input().split())
    sch.append([x + l, x - l])

sch.sort()
ans = 0
t = -float('inf')
for ed, st in sch:
    if t <= st:
        ans += 1
        t = ed
print(ans)
n = int(input())
xl = []
lr = []
for _ in range(n):
    x, l = map(int, input().split())
    xl.append([x, l])
    lr.append([x-l, x+l])

lr.sort(key=lambda x: x[1])

ans = 0
r = -float("inf")
for i in range(n):
    if r <= lr[i][0]:
        ans += 1
        r = lr[i][1]

print(ans)
n = int(input())
a = []
for i in range(n):
    x,l = map(int,input().split())
    s = x-l
    g = x+l
    a.append((s,g))

a = sorted(a, reverse=False, key=lambda x: x[1]) 
tmp = a[0][1]
ans = 1
for i in range(1,len(a)):
    if tmp <= a[i][0]:
        tmp = a[i][1]
        ans += 1 

print(ans)
n=int(input())
data=[]
for i in range(n):
    x,l=map(int,input().split())
    data.append([x+l,x-l])
data.sort()
ans=1
arm=data[0][0]
for i in range(n):
    if arm<=data[i][1]:
        ans+=1
        arm=data[i][0]
print(ans)
n = int(input())
x_list = []
for _ in range(n):
    x, l = map(int, input().split())
    x_list.append((x + l, x - l))
x_list.sort()
ans = 0
for i in range(n):
    x_max, x_min = x_list[i]
    if i == 0:
        t = x_max
        continue
    if x_min < t:
        ans += 1
        continue
    t = x_max
print(n - ans)
N=int(input())
X=[]
for i in range(N):
	x, L = map(int, input().split())
	X.append([x-L, x+L])
from operator import itemgetter

W=sorted(X, key=itemgetter(1))

ans=0
last=-float("inf")

for s, e in W:
	if s>=last:
		last=e
		ans+=1
print(ans)
import sys
input = sys.stdin.buffer.readline
from operator import itemgetter

def main():
    N = int(input())
    lr = []
    for _ in range(N):
        p,l = map(int,input().split())
        lr.append((p-l,p+l))
        
    lr.sort(key = itemgetter(1,0))
    now = -10**10
    count = 0
    for i in range(N):
        if now <= lr[i][0]:
            count += 1
            now = lr[i][1]
        
    print(count)
    
if __name__ == "__main__":
    main()
N=int(input())
XL=sorted([list(map(int,input().split())) for i in range(N)],key=lambda x:x[0]+x[1])
count=0
left=-10**9
for x,l in XL:
    if left<=x-l:
        count+=1
        left=x+l
print(count)
N = int(input())

list_ = list()

for i in range(N):
  X,L = map(int,input().split())
  max_ = min(10**9,X+L-0.1)
  min_ = max(0,X-L+0.1)
  list_.append((X,min_,max_))
list_.sort()

d = 0
nowmax = -1
nowmin = -1

for x, min_, max_ in list_:
  if nowmax > min_:
    d += 1
    nowmax = min(nowmax,max_)
  else:
    nowmin = min_
    nowmax = max_
  
print(N-d)
n = int(input())
rs = [list(map(int, input().split())) for _ in range(n)]
lr = [[x-l, x+l] for x, l in rs]
lr.sort(key=lambda x: x[1])

cnt = 0
reach = None
for l, r in lr:
    if reach is not None and l < reach:
        continue
    reach = r
    cnt += 1
print(cnt)
n = int(input())
L = []
for _ in range(n):
    x, l = map(int, input().split())
    L.append([x - l, x + l])
L = sorted(L, key=lambda x: x[1])
ans = 0
r = -float('inf')
for i in range(n):
    if L[i][0] >= r:
        ans += 1
        r = L[i][1]
print(ans)
n=int(input())
x=[0]*n
L=[0]*n
lis=[]

for i in range(n):
  x[i],L[i]=map(int,input().split())
  lis.append([x[i]-L[i],x[i]+L[i]])
lis.sort(key= lambda x:x[1])
tmp=-10**18
ct=0
for x in lis:
  if x[0]>=tmp:
    ct+=1
    tmp=x[1]
    
print(ct)
n = int(input())
L = []
for _ in range(n):
    x, l = map(int, input().split())
    left = x - l
    right = x + l
    L.append((left, right))
L = sorted(L, key=lambda x: x[1])
ans = 0
prev = -float('inf')
for r in L:
    if r[0] >= prev:
        ans += 1
        prev = r[1]
print(ans)
import sys
input = sys.stdin.readline
N=int(input())
list=[0 for i in range(N)]
for  i in range(N):
 x,l=map(int,input().split())
 list[i]=[x-l,x+l]
list.sort(key=lambda x: x[1])
ans=0
haji=-(10**10)
for  i in range(N):
 if list[i][0]>=haji:
  ans+=1
  haji=list[i][1]
print(ans)
import math
from typing import List, Any


def read_int() -> int:
    return int(input().strip())


def read_ints() -> List[int]:
    return list(map(int, input().strip().split(' ')))


def solve() -> Any:
    N = read_int()
    answer = 0
    INF = 10**10
    XL = []
    for i in range(N):
        XL.append(read_ints())
    XL.sort(key=lambda xl: xl[0]+xl[1])
    current = -INF
    for x, l in XL:
        if x-l >= current:
            answer += 1
            current = x+l
    return answer


if __name__ == '__main__':
    print(solve())
#input
N = int(input())
S = []
T = []
for i in range(N):
    X_temp, L_temp = map(int, input().split())
    S.append(X_temp - L_temp)
    T.append(X_temp + L_temp)

#output
import numpy as np
S = np.array(S)
T = np.array(T)
idx = np.argsort(T)

S = S[idx]
T = T[idx]
answer = 0
length = -10**10
for i in range(N):
    if length <= S[i]:
        answer += 1
        length = T[i]

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

XL.sort(key=lambda x: (x[0] + x[1], x[0] - x[1]))

myinf = 10 ** 9 + 7

saved = []
pos = -myinf
for i, (Xi, Li) in enumerate(XL):
    # print("#", Xi, Li, (Xi - Li, Xi + Li))
    if Xi - Li < pos: continue
    #
    saved.append(i)
    pos = Xi + Li

print(len(saved))
import bisect
N=int(input())

rllist=[]
for _ in range(N):
  X,L=map(int,input().split())
  rllist.append((X+L,X-L))
rllist.sort()
#print(rllist)

dp=[0]*N
dp[0]=1
for i in range(1,N):
  r,l=rllist[i]
  
  pos=bisect.bisect(rllist,(l,float("inf")))
  #print(i,pos)
  if pos==0:
    dp[i]=dp[i-1]
  else:
    dp[i]=max(dp[i-1],dp[pos-1]+1)
  
#print(dp)
print(dp[-1])
from itertools import groupby
from operator import itemgetter
import numpy as np
N = int(input())
arm = []
for i in range(N):
  x, l = map(int, input().split())
  a = [x-l, x+l]
  arm.append(a)
arm = sorted(arm, key=lambda x: x[1])
now = arm[0][1]
count = 1
for i in range(1,N):
  if now <= arm[i][0]:
    count += 1
    now = arm[i][1]
print(count)
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    N=int(input())
    A=[]
    for i in range(N):
        X,L=map(int,input().split())

        A.append([X-L,X+L])

    A=sorted(A, key=lambda x: x[1])
    cur=-(10**10)
    cnt=0
    for i in range(N):
        if A[i][0]<cur: continue
        else:
            cur=A[i][1]
            cnt+=1
    print(cnt)



    
    

    
resolve()
def solve(n, x, l):
    p = sorted([(a+b, a-b) for a, b in zip(x, l)])
    _, th = p[0]
    best = 0
    for t, s in p:
        if th <= s:
            best += 1
            th = t
    return best

n = int(input())
x = [0]*n
l = [0]*n
for i in range(n):
    x[i], l[i] = map(int, input().split())
print(solve(n, x, l))
N=int(input())
P=[[int(i) for i in input().split()] for  _ in range(N)]
arm=[[p[0]-p[1], p[0]+p[1]] for p in P]
s_arm=sorted(arm, key=lambda x: x[1])

#tは最後に選んだ仕事の終了時間
ans = 0
t = -10**9
for i in range(N):
    if (t <= s_arm[i][0]):
        ans+=1
        t = s_arm[i][1]
print(ans)
import sys
input = sys.stdin.readline

n = int(input())
xl = [list(map(int, input().split())) for _ in range(n)]
xl2 = sorted([[x + l, x - l] for x, l in xl])

ans = 0
mr = xl2[0][1]
for r, l in xl2:
    if l >= mr:
        ans += 1
        mr = r
print(ans)
#!/usr/bin python3
# -*- coding: utf-8 -*-

def main():
    N = int(input())
    XL = [None] * N
    for n in range(N):
        X, L = map(int,input().split())
        XL[n] = [X-L,X+L]
    XL.sort(key=lambda x:x[1])
    ret = 1
    TMP = XL[0][1]
    for x in XL[1:]:
        if TMP<=x[0]:
            TMP = x[1]
            ret += 1
    print(ret)

if __name__ == '__main__':
    main()
n = int(input())
a = [[0,0] for _ in range(n)]

for i in range(n):
    a[i][0],a[i][1]=map(int,input().split())
    a[i][0],a[i][1]=(a[i][0]-a[i][1]),(a[i][0]+a[i][1])
a.sort(key=lambda x: x[1])
INF = 10**10
preR = -INF
cnt=0
for L,R in  a:
    if L<preR:
        continue
    cnt+=1
    preR=R
print(cnt)
n = int(input())
xl = [list(map(int, input().split())) for _ in range(n)]
arms = [[xl[i][0] - xl[i][1], xl[i][0] + xl[i][1]] for i in range(n)]
arms.sort(key=lambda x: x[1])

ans = 1
ne = arms[0][1]
for i in range(n):
    if arms[i][0] >= ne:
        ne = arms[i][1]
        ans += 1
print(ans)
n = int(input())
arm = []
for i in range(n):
    x, l = map(int, input().split())
    arm.append([x-l, x+l])

arm.sort(key = lambda x: x[1])
ans = 0
now = -10**10
for i in range(n):
    if now <= arm[i][0]:
        ans += 1
        now = arm[i][1]

print(ans)
N = int(input())
l = []

for _ in range(N):
    X, L = map(int, input().split())
    l.append((X-L, X+L))

l.sort(key=lambda x:x[1])
before = -10**9
ans = 0

for i, j in l:
    if i>=before:
        ans += 1
        before = j

print(ans)
n = int(input())

lst = []
for i in range(n):
    xi, li = map(int, input().split())
    lst.append([xi, li])

lst_2 = []
for i in range(n):
    xi, li = lst[i][0], lst[i][1]
    lst_2.append([xi-li, xi+li])

lst_2.sort(key=lambda x: x[1])

cnt = 1
right = lst_2[0][1]
for i in range(1, n):
    if lst_2[i][0] >= right:
        right = lst_2[i][1]
        cnt += 1

print(cnt)
N = int(input())
l = []

for i in range(N):
    a, b = map(int, input().split())
    l.append((a-b,a+b))

l = sorted(l,key=lambda x:x[1])

start = l[0][1]
ans = 1
for i in range(1,N):
    if start <= l[i][0]:
        start = l[i][1]
        ans += 1

print(ans)
def main():
    N = int(input())
    robot = []
    for _ in range(N):
        X, L = map(int, input().split())
        robot.append([X-L,X+L])

    robot.sort(key=lambda x: x[1])
    cnt = 1
    l = robot[0][1]
    for i in range(1,N):
        if l <= robot[i][0]:
            cnt += 1
            l = robot[i][1]

    print(cnt)


if __name__ == "__main__":
    main()
n = int(input())
r = []
for _ in range(n):
    x,l = map(int,input().split())
    r.append([x+l, x-l])
r.sort()
tmp = r[0]
cnt = 0
for i in range(1, n):
    if r[i][1] < tmp[0]:
        cnt += 1
    else:
        tmp = r[i]
print(n-cnt)
n = int(input())
data = []
for i in range(n):
    x, l = map(int, input().split())
    data.append([x, l])
data = sorted(data, key = lambda x: x[0] + x[1])
ans = 0
pre = -(10 ** 10)
for i in range(n):
    if data[i][0] - data[i][1] >= pre:
        ans += 1
        pre = data[i][0] + data[i][1]

print(ans)
n = int(input())
a = []

for i in range(n):
    x,l = map(int,input().split())
    a.append([x+l, x-l])

a.sort()

ans = 1
hold = a[0]

for i in range(1,n):
    temp = a[i]
    if(hold[0] <= temp[1]):
        hold = temp
        ans += 1
        
    
print(ans)
N, *A = map(int, open(0).read().split())
X = [(x-l, x+l) for x, l in zip(*[iter(A)]*2)]
X.sort()
ans = 1
L, R = X[0]
for l, r in X[1:]:
    if R <= l:
        ans += 1
        L = l
        R = r
    elif R > r:
        R = r
print(ans)
n = int(input())
xl = [list(map(int, input().split())) for _ in range(n)]
ran = [[xl[i][0]-xl[i][1], xl[i][0]+xl[i][1]] for i in range(n)]
ran = sorted(ran, key=lambda x:x[1])
ans = n
right = ran[0][1]
for i in range(1, n):
  l, r = ran[i]
  if l < right:
    ans -= 1 
  else:
    right = r 
 
print(ans)
N = int(input())
XL = [list(map(int, input().split())) for _ in range(N)]
RL = [[0, 0] for _ in range(N)]
for i in range(N):
    left = XL[i][0] - XL[i][1]
    right = XL[i][0] + XL[i][1]
    RL[i][0] = left
    RL[i][1] = right
 
RL.sort(key=lambda x: x[1])
now_right = RL[0][1]
cnt = 0
for i in range(1, N):
    if now_right <= RL[i][0]:
        now_right = RL[i][1]
    else:
        cnt += 1
print(N - cnt)
n = int(input())
ps = []
cur = -10 ** 18
ans = n
for i in range(n):
    x, l = map(int, input().split())
    ps.append([x - l, x + l])

ps = sorted(ps, key=lambda x: x[1])

for i in range(n):
    if ps[i][0] >= cur:
        cur = ps[i][1]
    else:
        ans -= 1
print(ans)
import copy

n = int(input())
A = []

for i in range(n):
    a = [int(x) for x in input().split()]
    a.append(a[0]+a[1])
    A.append(a)

A.sort(key=lambda x: x[2])
#print(A)

count = 0
max_l = -10000000000
for i in A:
    if i[0]-i[1] >= max_l:
        count += 1
        max_l = i[2]

print(count)
n = int(input())

intervals = []

for _ in range(n):
    x, l = list(map(int, input().split()))
    intervals.append((x-l, x+l))

intervals = sorted(intervals, key=lambda x: x[1])

cnt = n
lastEnd = intervals[0][1]

for i in range(1, n):
    if intervals[i][0] < lastEnd:
        cnt -= 1
    else:
        lastEnd = intervals[i][1]

print(cnt)
n=int(input())
xllist=[list(map(int,input().split())) for _ in range(n)]
s_e=[]
for xl in xllist:
    s_e.append([xl[0]-xl[1],xl[0]+xl[1]])
s_e.sort(key=lambda x: x[1])
now=s_e.pop(0)[1]
ans=1
for xl in s_e:
    if now<=xl[0]:
        ans+=1
        now=xl[1]
print(ans)
from operator import itemgetter

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

st = sorted([(s[i], t[i]) for i in range(n)], key=itemgetter(1))
ans = 0
last = -10**10

for i in range(n):
    if last <= st[i][0]:
        ans += 1
        last = st[i][1]

print(ans)
n=int(input())
 
L=[]
for i in range(n):
    x,l=map(int,input().split())
    L.append([x-l,x+l])
L.sort(key=lambda x:x[1])
 
ans=1
bef=L[0][1]
for i in range(1,n):
    if bef<=L[i][0]:
        bef=L[i][1]
        ans+=1
print(ans)
n=int(input())
l=[]
for i in range(n):
    a,b=map(int,input().split())
    l.append([a-b,a+b])
l.sort(key=lambda x: x[1])
ans=1
nl=l[0][0]
nr=l[0][1]
for i in range(1,n):
    if l[i][0]<nr:
        continue
    else:
        nr=l[i][1]
        ans+=1
print(ans)
import bisect

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


XL = sorted(XL)
MM.sort(key=lambda x: x[0])
MM.sort(key=lambda x: x[1])
ans = 0
now  = -float('inf')
for i in range(N):
    if MM[i][0] >= now:
        ans += 1
        now = MM[i][1]
print(ans)