peterverebics/CodeNet_Python_118 huggingface dataset:
n = int(input())
a = sorted((tuple(map(int, input().split())) for _ in range(n)), key=sum)
r = 0
p = -10**9
for x, l in a:
  if x - l >= p:
    r += 1
    p = x + l
print(r)
import sys
input = sys.stdin.readline

N = int(input())
R = []

for i in range(N):
	x,l = map(int, input().split())
	R.append([max(x-l,0),x+l])
R.sort(key = lambda r : r[1])

ans = N
lr = -1
for i in range(N):
	if(lr > R[i][0]):
		ans -=1
		continue
	else:
		lr = R[i][1]
print(ans)
N = int(input())

X = []
L = []
Y = []
for i in range(N):
  tx,tL = map(int,input().split())
  X.append(tx)
  L.append(tL)
  Y.append((tx-tL,tx+tL))

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

select = 0
for i in range(N):
  if i == 0:
    temp = Y[i][1] #今の終わり
    select += 1
  else:
    if Y[i][0] >= temp: #今の終わりより次の始まりの方が後ならおｋ
      temp = Y[i][1]
      select += 1
print(select)
N=int(input())
A=[list(map(int,input().split())) for i in range(N)]
B=[]
for i in range(N):
  B.append([A[i][0]-A[i][1],A[i][0]+A[i][1]])
C=sorted(B, key=lambda x: x[1])
cnt=0
r=-1*10**9
for i in range(N):
  if r<=C[i][0]:
    cnt+=1
    r=C[i][1]
print(cnt)
n=int(input())
ll=[]
for _ in range(n):
    x,l=map(int,input().split())
    ll.append((x+l,x-l))
ll=sorted(ll)
ans=0
c=-10**10
for t,s in ll:
    if c<=s:
        c=t
        ans+=1
print(ans)
n = int(input())
r = [list(map(int,input().split())) for _ in range(n)]
for i in range(n):
  r[i] = [r[i][0] - r[i][1], r[i][0] + r[i][1]]
r.sort(key = lambda x:x[1])
#print(r)
cur = -1001001001
ans = 0
for i in range(n):
  if cur <= r[i][0]:
    ans += 1
    cur = r[i][1]
print(ans)
n = int(input())
xlt = []
for i in range(n):
    xi,li = map(int,input().split())
    xlt.append((xi+li,xi-li))
xlt.sort()
ans = 0
x = -float("INF")
for i in range(n):
    if x <= xlt[i][1]:
        ans += 1
        x = xlt[i][0]
print(ans)
#!/usr/bin/env python
# coding: utf-8

# In[8]:


N = int(input())
mylist = []
for _ in range(N):
    x,l = map(int, input().split())
    a = x-l
    b = x+l
    mylist.append([a,b])


# In[12]:


mylist = sorted(mylist,key=lambda x:x[1])
cnt = 1
p = mylist[0][1]
for i in range(1,N):
    if mylist[i][0] < p:
        continue
    else:
        cnt += 1
        p = mylist[i][1]
print(cnt)


# In[ ]:
#わからんけどとりあえず貪欲
N = int(input())

robots = []
for i in range(N):
    X,L = list(map(int,input().split()))
    robots.append((X-L,X+L))

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

point = -(10**9)
ans = 0
for i in range(N):
    if point <= robots[i][0]:
        ans += 1
        point = robots[i][1]

print(ans)
import heapq
n = int(input())
robots = []
for _ in range(n):
    robot = tuple(map(int, input().split()))
    heapq.heappush(robots, robot)

robot = heapq.heappop(robots)
max_right = robot[0] + robot[1]
del_count = 0
for i in range(len(robots)):
    robot = heapq.heappop(robots)
    if max_right > robot[0] - robot[1]:
        del_count += 1
        max_right = min(max_right, robot[0] + robot[1])
    else:
        max_right = robot[0] + robot[1]
print(n-del_count)
n=int(input())
B=[]
for i in range(n):
  x,l=map(int,input().split())
  B.append([x-l,x+l])
B.sort(key=lambda x:x[1])
max_l=-10**18-5
ans=0
for b in B:
  if max_l <= b[0]:
    max_l = b[1]
    ans+=1
print(ans)
# -*- coding: utf-8 -*-
N = int(input())

robo_dic = {}
for i in range(N):
    X, L = map(int, input().split())
    robo_dic[X] = L

robo_list = sorted(robo_dic.keys())

max_place = robo_list[0] + robo_dic[robo_list[0]]
ans = 1
for i in range(1, len(robo_list)):
    x = robo_list[i]
    l = robo_dic[x]
    if max_place <= x - l:
        ans += 1
        max_place = x + l
    else:
        max_place = min(max_place, x + l)
print(ans)
n=int(input())
points = []
for _ in range(n):
  X,L = map(int,input().split())
  points.append([X+L, X -L])
points.sort(key = lambda x: x[0])
cur = -10**9
answer = 0
for point in points:
  if point[1] >= cur:
    answer += 1
    cur = point[0]
print(answer)
N = int(input())
robots, count = [], 0
for x in range(N):
    X, L = map(int, input().split())
    robots.append((X+L, X-L))
robots.sort()
node = -10**12
for end, start in robots:
    if start >= node:
        node = end
        count += 1
print(count)
N = int(input())
arm_range = []
for _ in range(N):
    X,L = map(int,input().split())
    arm_range.append([X+L,X-L])

arm_range = sorted(arm_range)

limit = arm_range[0][0]
ans = 1

for i in range(1,N):
    if arm_range[i][1] >= limit:
        ans += 1
        limit = arm_range[i][0] 

print(ans)
# Keyence B

N = int(input())
robot_list = []
robot_count = 0

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

robot_list.sort()
r = - 10**9 - 1

for i in range(N):
    if r <= robot_list[i][1]:
        robot_count += 1
        r = robot_list[i][0]

print(robot_count)
def main():
    n = int(input())
    L = []
    for _ in range(n):
        x,l = map(int,input().split())
        L.append([x+l,x-l])

    L.sort()

    cnt = 0
    right = -10**9
    for r,l in L:
        if right <= l:
            cnt += 1
            right = r

    print(cnt)

main()
n=int(input())
rob=[list(map(int,input().split())) for i in range(n)]
rob=[[sum(rob[i]), rob[i][0]-rob[i][1]] for i in range(n)]
rob.sort(key=lambda i:i[0])
robp=[rob[i][0] for i in range(n)]
robm=[rob[i][1] for i in range(n)]
#print(robp)
#print(robm)

ans=0
x=-10**9
for i in range(n):
  if x<=robm[i]:
    ans+=1
    x=robp[i]
print(ans)
def resolve():
    import sys
    from operator import itemgetter
    readline = sys.stdin.readline
    N = int(readline())
    LR = [None] * N
    for i in range(N):
        p, l = map(int, input().split())
        LR[i] = [p-l, p+l]
    LR.sort(key=itemgetter(1))

    pre_r = -(10**18)
    count = 0
    for l, r in LR:
        if pre_r <= l:
            count += 1
            pre_r = r
    print(count)

resolve()
import sys
input = sys.stdin.readline

N = int(input())
XL = []
for _ in range(N):
    tmp = [int(x) for x in input().split()]
    XL.append(tmp)
LR = []
for i in XL:
    LR.append([i[0] - i[1], i[0] + i[1]])
LR.sort()
ans = N
last = LR[0][1]
for i in range(1, N):
    if last > LR[i][0]:
        if last > LR[i][1]:
            last = LR[i][1]
        ans -= 1
    else:
        last = LR[i][1]
print(ans)
n = int(input())
ts = []
for i in range(n):
    x, l = map(int, input().split())
    t = x + l
    s = x - l
    ts.append([t, s])

ts.sort()
ans = 0
T = float("inf") * - 1
for i in range(n):
    if T <= ts[i][1]:
        ans += 1
        T = ts[i][0]

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
check1 = A[0]
for i in range(1, N):
    check2 = A[i]
    if check1[0] <= check2[1]:
        ans += 1
        check1 = check2
print(ans)
N=int(input())

#S = [[0 for j in range(3)] for i in range(2)]　2行3列の場合
S = [[0 for j in range(2)] for i in range(N)]

for i in range(N):
    X,L=map(int,input().split())
    S[i][0]=X-L
    S[i][1]=X+L


T=sorted(S,key=lambda x:x[1])
#U=sorted(T,key=lambda x:x[1])
if N==1:
    print(1)
    exit()


count=1
last=T[0][1]
for i in range(1,N):
    if T[i][0]>=last:
        count+=1
        last=T[i][1]
print(count)
n=int(input())
lists=[]
for i  in range(n):
    x,y=map(int,input().split())
    lists.append((x-y,x+y))
lists=sorted(lists,key=lambda x:(x[1]))
A=1
P=lists[0]
for i in range(1,len(lists)):
    if lists[i][0]>=P[1]:
        A+=1
        P=lists[i]
print(A)
n = int(input())
robots = []
for _ in range(n):
    x, l = map(int, input().split())
    robots.append([x-l, x+l])

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

cnt = 1
current_end = robots[0][1]
for i in range(1, n):
    if current_end <= robots[i][0]:
        cnt += 1
        current_end = robots[i][1]

print(cnt)
n = int(input())
rl = []
for i in range(n):
    x,l = map(int,input().split())
    rl.append([x+l,x-l])
rl.sort()
ans = 1
migihasi = rl[0][0]
hasikouho = []
for i in range(1,n):
    right = rl[i][0]
    left = rl[i][1]
    if left < migihasi:continue
    migihasi = right
    ans += 1

    
        
 
print(ans)
n=int(input())
lr=[]
for i in range(n):
  x,l=map(int,input().split())
  lr.append((x-l,x+l))
lr.sort(key=lambda x: x[1])
ans=0
l=-10**18
r=0
for i in range(n):
  if i==0:
    tl,tr=lr[i]
    l=tl
    r=tr
    ans+=1
    continue
  tl,tr=lr[i]
  if tl>=r:
    ans+=1
    r=tr
    l=tl
print(ans)
N = int(input())
Robot = []
for i in range(N):
    a, b = map(int, input().split())
    Robot.append((a - b, a + b))
now = -10000000000
Robot.sort(key=lambda x: x[1])
ans = 0

for i in range(N):
    if Robot[i][0] >= now:
        ans +=1
        now = Robot[i][1]

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

ans = 1
tmp = rng[0][1]
for i in range(1, n):
    l, r = rng[i]
    if tmp <= l:
        ans += 1
        tmp = r

print(ans)
N = int(input())

X = []

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

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

count = 0
prev = -10**27
for i in range(N):
    if prev<=X[i][0]:
        prev = X[i][1]
        count+=1

print(count)
n = int(input())
xl_lis = []
for i in range(n):
    xl_lis.append(list(map(int, input().split())))
fe_lis = []

for x, l in xl_lis:
    fe_lis.append([x - l, x + l])
fe_lis.sort(key = lambda x:x[1])        
curr = float("-inf")
cnt = 0
for f, e in fe_lis:
    if curr <= f:
        cnt += 1
        curr = e
print(cnt)
n = int(input())
robo = [0] * n
for i in range(n):
    x, l = map(int, input().split())
    robo[i] = (x - l, x + l)
robo.sort(key=lambda x: x[1])

max_r, cnt = -float('inf'), 0
for l, r in robo:
    if  max_r <= l:
        cnt += 1
        max_r = r
print(cnt)
N=int(input())
R=[]
for i in range(N):
    X,L=map(int, input().split())
    R.append((X-L,X+L))

R=sorted(R)
now=-(10**9+1)
minr=-(10**9+1)
count=0
for t in R:
    l,r=t
    if now<=l:
        if l<minr:
            minr=min(r,minr)
        else:
            count+=1
            now=l
            minr=r
    else:
        continue

print(count)
import sys
import heapq
input = sys.stdin.readline

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

# 貪欲
heapq.heapify(query)

finish, start = heapq.heappop(query)
time = finish
count = 1
while len(query) > 0:
    finish, start = heapq.heappop(query)
    if start >= time:
        time = finish
        count += 1
    else:
        continue
print(count)
def m():
    N = int(input())
    XL = [list(map(int, input().split())) for _ in range(N)]
    ST = [[xl[0] - xl[1], xl[0] + xl[1]] for xl in XL]
    ST.sort(key=lambda x: x[1])
    ans = 1
    right = ST[0][1]
    for i in range(1, N):
        if right <= ST[i][0]:
            right = ST[i][1]
            ans += 1
    return ans


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

for i in range(1,n):
    if ls[i][0] < ls[i-1][1]:
      ls[i][1] = ls[i-1][1]
      ans -=1
        
print(ans)
N = int(input())
XL = [tuple(map(int,input().split())) for i in range(N)]
XL.sort(key=lambda x: x[0]+x[1])
right = -float('inf')
ans = 0
for x,l in XL:
    s,t = x-l, x+l-1
    if s > right:
        right = t
        ans += 1
print(ans)
N = int(input())
XL = []
for i in range(N):
    XL.append(list(map(int, input().split())))
XL = list(map(lambda x: [x[0] - x[1], x[0] + x[1]], XL))
 
XL = sorted(XL, key=lambda x: x[1])

r = XL[0][1]
cnt = 1
for i in range(1, N):
    if XL[i][0] >= r:
        r = XL[i][1]
        cnt += 1
print(cnt)
N = int(input())
ABs = []
for i in range(N):
  X, L = map(int, input().split())
  A, B = X-L, X+L
  ABs.append((A, B))
ABs.sort(key=lambda AB: AB[1])
#print(ABs)
r = 1
b = ABs[0][1]
for i in range(1, N):
  A, B = ABs[i]
  if A >= b:
    r += 1
    b = B
print(r)
import sys
N = int(sys.stdin.readline().rstrip())
sec = []

for _ in range(N):
    x, l = map(int, sys.stdin.readline().rstrip().split())
    sec.append((x - l, x + l))

sec = sorted(sec, key=lambda x: x[1])
r = -10**10
ans = 0
for s, t in sec:
    if r <= s:
        ans += 1
        r = t
print(ans)
n = int(input())

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

ass = 0
tt = -float("inf")
for i in range(n):
    if tt < itv[i][1]:
        ass += 1
        tt = itv[i][0]
print(ass)
# https://atcoder.jp/contests/keyence2020/tasks/keyence2020_b
n = int(input())
robots = []
for _ in range(n):
    x, l = map(int, input().split())
    a, b = x - l, x + l
    robots.append((a, b))

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

t = 0
pre = robots[0][1]
for i in range(1, n):
    a, b = robots[i]
    if a < pre:
        t += 1
    else:
        pre = b
ans = n - t
print(ans)
N = int(input())
ans = 0
a = - (1 << 100)
X = []
for _ in range(N):
    x, l = map(int, input().split())
    X.append((x, l))
X = sorted(X)
for x, l in X:
    if a > x - l:
        a = min(a, x + l)
    else:
        a = x + l
        ans += 1
print(ans)
# -*- coding: utf-8 -*-
N = int(input())
U = []
for i in range(N):    
    x, l = (map(int,input().split()))
    u = [x+l,x-l]
    U.append(u)
U.sort()

ans = 1
x = U[0][0]
for i in range(N-1):
    if U[i+1][1] >= x:
        ans += 1
        x = U[i+1][0]
print(ans)
from operator import itemgetter
N, *A = map(int, open(0).read().split())
X = [(x-l, x+l) for x, l in zip(*[iter(A)]*2)]
X.sort(key=itemgetter(1))
ans = 0
R = -float('inf')
for l, r in X:
    if R <= l:
        ans += 1
        R = r
print(ans)
import sys

if __name__ == "__main__":
    N = int(input())
    X = []
    for _ in range(N):
        x, l = [int(x) for x in input().split(" ")]
        X.append((x - l, x + l))

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

    count = 0
    max_high = -sys.maxsize
    for low, high in X:
        if max_high <= low:

            count += 1
            max_high = high
    print(count)
N = int(input())

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

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

count = 0
max_arm = -float("inf")
for robo in robots:
    if robo[0] < max_arm:
        count += 1
    else:
        max_arm = robo[1]

print(N - count)
N = int(input())
arm = [list(map(int, input().split())) for _ in range(N)]
dist = [[0 for _ in range(3)] for _ in range(N)]

for i in range(N):
  dist[i][0] = arm[i][0] + arm[i][1]
  dist[i][1] = arm[i][0]
  dist[i][2] = arm[i][1]

dist.sort()

ans = 1
left = dist[0][1] + dist[0][2]
for i in range(1, N):
  if left <= dist[i][1] - dist[i][2]:
    ans += 1
    left = dist[i][1] + dist[i][2]

print(ans)
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
for i in range(N):
  r,l=rllist[i]
  
  pos=bisect.bisect(rllist,(l,float("inf")))
  #print(i,pos)
  dp[i]=max(dp[i-1],dp[pos-1]+1)
  
#print(dp)
print(dp[-1])
n = int(input())

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

arm = xl[0][1] 
cnt = 1
for i in range(1,n):
    x,l = xl[i][0],xl[i][1]

    if arm <= xl[i][0]:
        arm = xl[i][1]
        cnt +=1
        
print(cnt)
# -*- coding: utf-8 -*-
N = int(input())
items = [list(map(int, input().split())) for i in range(N)]
items = sorted(items, key=lambda x:x[0]+x[1])
res = 0
bf =  -10**9
for x, l in items:
    if bf <= x - l:
        res += 1
        bf = x + l
print(res)
import sys
input = sys.stdin.readline

N = int(input())
robots, count = [], 0
for x in range(N):
    X, L = map(int, input().split())
    robots.append((X+L, X-L))
robots.sort()
node = -10**12
for end, start in robots:
    if start >= node:
        node = end
        count += 1
print(count)
M,a=-float("inf"),0
for X,L in sorted(zip(*[iter(map(int,open(0).read().split()[1:]))]*2),key=sum):
 l,r=X-L,X+L
 if M<=l:a+=1;M=r
print(a)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10000000)
from collections import defaultdict
from bisect import *
mod = 10**9+7

N = int(input())
XL = [list(map(int, input().split())) for i in range(N)]
A = [(X+L, X-L) for X, L in XL]
A.sort()
cnt, last = 0, A[0][0]
for s, t in A[1:]:
    if t < last:
        cnt += 1
    else:
        last = s
print(N-cnt)
#B
n = int(input())
robot = []
for i in range(n):
    x,l = map(int, input().split())
    ri = x - l
    le = x + l
    robot.append([ri, le])
robot.sort(key=lambda x: x[1])
# print(robot)
a = robot[0][1]
count=1
for i in range(1, n):
    if a > robot[i][0]:
        pass
    else:
        # print(robot[i])
        #残せる
        a = robot[i][1]
        count += 1
print(count)
N = int(input())
x = []
l = []
for i in range(N):
    x1,l1=[int(i) for i in input().split()]
    x.append(x1)
    l.append(l1)

Range = []

for i in range(N):
  max_i = x[i] + l[i]
  min_i = x[i] - l[i]
  Range.append((min_i,max_i))

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

a = 1
for i in range(N-1):
  if Range[a][0] >= Range[a-1][1]:
    a += 1
  else:
    Range.pop(a)

print(a)
N=int(input())
L=[]
for i in range(N):
    x,l=map(int,input().split())
    a,b=x-l,x+l
    L.append((a,b))
L.sort(key=lambda  ab: ab[1])
#print(L)
robot=1
b=L[0][1]
for i in range(1,N):
    A,B=L[i]
    if A>=b:
        robot+=1
        b=B
print(robot)
N = int(input())
X = []
X_L = []
X_L_dict = {}
for i in range(N):
    x, l = map(int, input().split())
    X_L.append([x-l, x+l])
    X.append(x-l)
X_L.sort(key=lambda x:x[1])
X.sort()

last = None

count = 0
# print(X_L)
for x_l in X_L:
    # print(x_l, last)
    if last is None or last <= x_l[0]:
        count += 1
        last = x_l[1]
print(count)
n=int(input())
l=[list(map(int,input().split())) for i in range(n)]
l.sort()
ans=1
c=l[0][0]+l[0][1]
for i in range(1,n):
    if c>=l[i][0]+l[i][1]:
        c=l[i][0]+l[i][1]
    elif c<=l[i][0]-l[i][1]:
        c=l[i][0]+l[i][1]
        ans+=1
print(ans)
class Robot:
    def __init__(self, left, right):
        self.left = left
        self.right = right
    
    def __lt__(self, other):
        return self.right < other.right

n = int(input().rstrip())
robos = [None] * n

for i in range(n):
    line = input().rstrip().split(' ')
    robos[i] = Robot(int(line[0]) - int(line[1]), int(line[0]) + int(line[1]))

robos.sort()

cur = -1000000000
ans = 0
for i in range(n):
    if cur <= robos[i].left:
        ans += 1
        cur = robos[i].right

print(ans)
N = int(input())
XL = [list(map(int,input().split())) for _ in range(N)]
r_l = []
for n in range(N):
  xl = XL[n]
  x = xl[0]
  l = xl[1]
  r_l.append([x-l,x+l])

r_l = sorted(r_l,key = lambda x:x[1])
ans = 1
l = r_l[0][1]
for a in r_l:
  if a[0]<l:
    continue
  else:
    ans += 1
    l = a[1]
    
print(ans)
n=int(input())
r=[]
cnt=1

for _ in range(n):
    x,l=map(int,input().split())
    s=x-l
    t=x+l
    r.append([s,t])
    
r=sorted(r,key=lambda x: x[1])
t0=r[0][1]

for s,t in r[1:]:
    if t0<=s:
        cnt+=1
        t0=t

print(cnt)
N = int(input())

num_array = [[0]*2 for i in range(N)]
for i in range(N):
    x, l = map(int, input().split())
    small = x-l
    if small <= 0:
        small = 0
    big = x+l

    num_array[i][1] = small
    num_array[i][0] = big

num_array.sort()

tmp_r = -(10**18)
count = 0
for r, l in num_array:
    if tmp_r > l:
        continue
    count += 1
    tmp_r = r

print(count)
from operator import itemgetter

N = int(input())

X = []
L = []

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

xl = sorted([(X[i],L[i]) for i in range(N)], key = itemgetter(1))

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

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

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

arr=[]

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

#print(arr)

ans = 0
start=-100000
fin=-1000

start = arr[0][2]
fin=arr[0][3]

for a,b,c,d in arr[1:]:
    if c < fin:
        ans+=1
        pass
    elif c >= fin:
        start=c
        fin = d

print(n-ans)
from sys import stdin

N = int(stdin.readline().rstrip())
X_list = []
L_list = []
#left_pos = []
#right_pos = []
range_pos = []
for i in range(N):
    [X, L] = [int(x) for x in stdin.readline().rstrip().split()]
    X_list.append(X)
    L_list.append(L)
    range_pos.append([X+L, X-L])

range_pos.sort()

index  = 0
prev_right = -1e8
for i in range(N):
    if prev_right <= range_pos[i][1]:
        prev_right = range_pos[i][0]
        index+=1

print(index)
N = int(input())
lls = []
rls = []
sels = []
for _ in range(N):
    x,l = map(int, input().split())
    lls.append(x-l)
    rls.append(x+l)
    sels.append([x-l,x+l])

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

start = -float('inf')

ans = 0
for item in sels:
    if start <= item[0]:
        ans += 1
        start = item[1]

print(ans)
n=int(input())
X=[[0]*3 for i in range(n)]
for i in range(n):
  a,b=map(int,input().split())
  X[i]=[a+b,a,b]
X=sorted(X)
l=X[0][0]
ans=1
for i in range(n):
  if X[i][1]-X[i][2]>=l:
    ans+=1
    l=X[i][0]
print(ans)
N = int(input())

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

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

last = robo[0][1]
cnt = 1
for r in robo[1:]:
    if r[0] >= last:
        cnt += 1
        last = r[1]

print(cnt)
N = int(input())
robot = [input().split() for i in range(N)]

le = [[int(i[0])-int(i[1]), int(i[0])+int(i[1])] for i in robot]
le.sort(key = lambda x:x[1])

ans = 0
floor = -10**9-1
for i in range(N):
    if floor <= le[i][0]:
        ans += 1
        floor = le[i][1]

print(ans)
N = int(input())
A = [list(map(int,input().split())) for _ in range(N)]
B = sorted([[A[i][0]-A[i][1],A[i][0]+A[i][1]] for i in range(N)],key=lambda x:x[1])
cur = 1
C = [B[0]]
while cur<N:
    if B[cur][0]>=C[-1][1]:
        C.append(B[cur])
    cur += 1
print(len(C))
n = int(input())
x = []
for i in range(n):
    X,L = map(int, input().split())
    x.append([X-L,X+L])
x.sort(key=lambda x:x[0])
ans = n
tmp = x[0][1]
for i in range(1,n):
    if tmp>x[i][0]:
        ans -=1
        tmp = min(tmp,x[i][1])
    else:
        tmp = x[i][1]
print(ans)
N = int(input())
XL = [list(map(int, input().split())) for _ in range(N)]

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

d.sort()

inf = float('inf')

pre = - inf
ans = N
for dd in d:
    if dd[0] - 2 * dd[1] < pre:
        ans -= 1
    else:
        pre = dd[0]

print(ans)
from collections import deque
N = int(input())
X = [0]*N
L = [0]*N
lis = deque()
for i in range(N):
    X[i], L[i] = map(int, input().split())
    lis.append([i,X[i]-L[i], X[i]+L[i]])

lis = sorted(lis, key=lambda x:x[2])
lis = deque(lis)

end = lis[0][2]
start = lis[0][1]
lis.popleft()
cnt = 1
while lis:
    x, y, z = lis.popleft()
    if y < end:
        continue
    elif y >= end:
        start = y
        end = z
        cnt += 1

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

d.sort(key=lambda x:x[1])
ma = -9999999
c = 0
for i in range(n):
    if(d[i][0] >= ma):
        ma = d[i][1]
        c += 1
print(c)
N = int(input())
robot = {}

for i in range(N):
  x, l = map(int, input().split())
  robot[x] = l

s_robot = sorted(robot.items(), key=lambda x:x[0])

pre_arm = -10**10
cnt = 0
for key, val in s_robot:
  l_arm = key - val
  r_arm = key + val
  if pre_arm > l_arm:
    cnt += 1
    if pre_arm > r_arm:
      pre_arm = r_arm
  else:
    pre_arm = r_arm
    
print(N-cnt)
n = int(input())
st = []
for i in range(n):
    x, l = map(int, input().split())
    st.append([x + l, x - l])

st.sort()
cnt = 1
right = st[0][0]
for i in range(1, n):
    if right <= st[i][1]:
        right = st[i][0]
        cnt += 1

print(cnt)
import numpy as np

n=int(input())

Z=np.zeros((n,4))
for i in range(n):
    Z[i][0],Z[i][1]=map(int, input().split())
    Z[i][2]=Z[i][0]+Z[i][1]
    Z[i][3]=Z[i][0]-Z[i][1]
Z2=Z[np.argsort(Z[:,2])]

ans=1
border=Z2[0][2]
for i in range(1,n):
    if Z2[i][3]>=border:
        ans+=1
        border=Z2[i][2]

print(ans)