peterverebics/CodeNet_Python_118 huggingface dataset:
N = int(input())
XL = []
for n in range(N):
    XL.append([int(x) for x in input().split()])
XL = sorted(XL, key=lambda x:(x[0],x[1]))
m = -float("inf")
ans = 0
for n in range(N):
    if XL[n][0]-XL[n][1] >= m:
        ans += 1
        m = XL[n][0]+XL[n][1]
print(ans)
n = int(input())
ans = n
d = {}
for i in range(n):
  x,l = map(int, input().split())
  d[x] = l
if n == 1:
  print(ans)
else:
  s = list(d.keys())
  s.sort()
  st = s[0]-d[s[0]]
  gl = s[0]+d[s[0]]
  for i in s[1:]:
    if st<i+d[i] and i-d[i]<gl:
      ans -= 1
      continue
    else:
      st = min(st,i-d[i])
      gl = min(gl,i+d[i])
print(ans)
n = int(input())
XL = []
for i in range(n):
  x, l = map(int, input().split())
  XL.append([x, l])
  
XL.sort(key=lambda x: x[0]-x[1])

seen = 0
ans = 0
for i in range(n):
  rob = XL[i]
  if i==0:
    seen = rob[0]+rob[1]
  else:
    if seen > rob[0]-rob[1]:
      ans +=1

    else:
      seen = rob[0]+rob[1]

print(n-ans)
n=int(input())
l=[input().split() for i in range(n)]
l=[[int(i) for i in j] for j in l]

l.sort()

left=[]
right=[]
count=1

for i in range(len(l)):
  left.append(l[i][0]-l[i][1])
  right.append(l[i][0]+l[i][1])
  if len(right)>1:
    if left[-1]<right[-2]:
      right=right[:(-1)]
      left=left[:(-1)]
    else:
      count+=1
print(count)
N = int(input())
robots = []
for _ in range(N):
    x, l = map(int, input().split())
    robots.append((x-l, x+l))

robots.sort(key=lambda x: x[1])  # 終端を昇順ソート
# print(robots)
rm = 0
rightest_point = robots[0][1] - 1
for i in range(1, N):
    if robots[i][0] + 1 > rightest_point:  # 被っていないから残せる
        rightest_point = robots[i][1] - 1
    else:
        rm += 1
print(N-rm)
n = int(input())
X = [list(map(int,input().split())) for _ in range(n)]
X.sort()
right = X[0][0]+X[0][1]
ans = n
for i in range(1,n):
    left = X[i][0]-X[i][1]
    if left < right:
        ans -= 1
    else:
        right = left
print(ans)
n=int(input())
a =[]
for _ in range(n):
  
  a.append([int(i) for i in input().split()])
  
a.sort(key = lambda x : x[0])
#a.sort(key = lambda x : x[1])
#print(a)

curi = 0;curj=1
cnt=1
while(curj<n):
  if a[curi][0]+a[curi][1] <= a[curj][0]-a[curj][1]:
    curi=curj
    cnt+=1
  else: curi= min(curi,curj)
  curj+=1
    
print(cnt)
N = int(input())
S = []
for _ in range(N):
    D = list(map(int, input().split()))
    S.append(D)

min_list=[]
for i in range(N):
    min_list.append([S[i][0],S[i][1],S[i][0] + S[i][1]])
min_list.sort(key=lambda x:x[2])

ans=0
current_min = -10*10
for i in range(N):
    if min_list[i][0] - min_list[i][1] >= current_min:
        ans+=1
        current_min = min_list[i][2]
print(ans)
N = int(input())
XL =[list(map(int, input().split())) for _ in range(N)]
LR = [[XL[i][0] - XL[i][1], XL[i][0] + XL[i][1]] for i in range(N)]
LR.sort()

cp = LR[0][1]

ans = 0

for i in range(1,N):
	if LR[i][0] < cp:
		ans += 1
	else:
		cp = LR[i][1]
print(N-ans)
n = int(input())
robot = [tuple(map(int, input().split())) for _ in range(n)]
robot = [(x - l, x + l) for x, l in robot]
robot.sort()

ans = 0
last = float('inf')
for l, r in robot:
  if last >= r:
    ans += 1
    last = l
    
print(ans)
n = int(input())
xl = sorted([tuple(map(int, input().split())) for _ in range(n)])

tmp = sum(xl[0])

res = 0
for i in range(1, n):
    x, l = xl[i]
    if tmp > x-l:
        res += 1
    else:
        tmp = x+l

print(n-res)
N = int(input())
arms = [list(map(int, input().split())) for _ in range(N)]

arms.sort()

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

print(ans)
N=int(input())
cnt=1
R=[[0]*2 for _ in range(N)]
for i in range(N):
  x,l=map(int,input().split())
  R[i][0]=(x-l+1)
  R[i][1]=(x+l-1)
  
#print(R)
R.sort(key=lambda x: x[1])
#print(R)
for i in range(1,N):
  if R[i][0]>R[i-1][1]:
    cnt+=1
print(cnt)
n = int(input())
lis = []
for _ in range(n):
  x, l= list(input().split(" "))
  p_d = int(x) + int(l)
  m_d = int(x) - int(l)
  lis.append([m_d, p_d])

lis.sort()
a = -10 ** 10
x = 0

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

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

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

ans = 0
t = -10**9
for i in range(N):
    if t < XL[i][0]:
        ans += 1
        t = XL[i][1]
print(ans)
n = int(input())

E = []
for i in range(n):
    x, l = map(int, input().split(' '))
    s = max(x - l, 0)
    g = min(x + l, 10**9)
    E.append((s, g))
E = sorted(E)

g = -1
count = 0
for e in E:
    s = e[0]
    if s < g:
        continue
    else:
        g = e[1]
        count += 1
print(count)
times = int(input())

robots = [map(int , input().split()) for i in range(times)]
print(robots.sort)
n = int(input())
data = [[]]*n
for i in range(n):
    x, l = map(int, input().split())
    data[i] = [x-l,x+l]
data.sort()
ans = n
if len(data) == 2:
  if data[0][1] > data[1][0]:
    ans -= 1
for i in range(1, n-1):
    if data[i-1][1] > data[i][0] and data[i][1] > data[i+1][0]:
        ans -= 1

print(ans)
n=int(input())
lo=[]
sh=[]

result=n


for i  in range(n):
    xx,ll=map(int, input().split())
    lo.append(xx+ll)
    sh.append(xx-ll)
    

c=zip(sh,lo)
d=sorted(c)

for i in range(n-1):
    if d[i+1][0] == -1:
        break
    if d[i+1][0] < d[i][1]:
        result-=1
        del d[i+1]
        tmp=(-1,-1)
        d.append(tmp)

print(result)
N = int(input())
rm = 0
r = -float('inf')
robot = sorted([list(map(int, input().split())) for i in range(N)])
for x, l in robot:
    if x - l < r:
        rm += 1
    else:
        r = x + l

print(N - rm)
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])
curr = float("-inf")
cnt = 0
for f, e in fe_lis:
    if curr <= f:
        cnt += 1
        curr = e
print(cnt)
n = int(input())

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

stock = []
stock.append(machines.pop(0))
while len(machines) > 0:
  point = machines.pop(0)
  if stock[-1][1] > point[0]:
    continue
  else:
    stock.append(point)

print(len(stock))
n = int(input())
robot = [
    list(map(int, input().split())) for i in range(n)
]
robot.sort(key=lambda x: x[0], reverse=True)
ans = [robot.pop()]
for i in range(1, n):
    robot_i = robot.pop()
    x_dif = robot_i[0] - ans[-1][0]
    r_necessary = robot_i[1] + ans[-1][1]
    if r_necessary <= x_dif:
        ans.append(robot_i)

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

P = [[x - l, x, x + l] for x, l in XL]
P.sort(key=lambda x: x[2])

leave = []
for i in range(N):
    # ロボットpiが既に残すと決めたロボットに重ならないことをチェック
    # print('Checking Robot P{}: {}'.format(i, P[i])) 
    if len(list([p for p in leave if p[1] >= P[i][0]])) == 0:
        leave.append(P[i])
        #print(leave)
    else:
        #print('Not Added')
        continue

print(len(leave))
N = int(input())
XL = []
flag = [0]*N
for i in range(N):
	xl = list(map(int,input().split()))
	XL.append(xl)
XL.sort()
for i in range(N-1):
	if(flag[i] == 0):
		if(XL[i][0]+XL[i][1]>=XL[i+1][0]):
			flag[i+1]+=1
sum = 0
for i in range(N):
	sum+=flag[i]
print(N-sum)
N = int(input())
r = [list(map(int, input().split())) for _ in range(N)]
r.sort()

ans = N
i = 1
l = i-1
while i < N:
    x1, l1 = r[l]
    x2, l2 = r[i]
    l = i
    if (x1+l1) > (x2-l2):
        i += 1
        ans -= 1
        if (x1+l1) > (x2+l2):
            l += 1
    i += 1
print(ans)
n=int(input())
lis=[]
for _  in range(n):
    x,l=map(int,input().split())
    #print(x,l)
    lis.append([x-l,x+l])

lis.sort(key=lambda x:x[0])
#print(lis)
count = 0
tmp = - 10 ** 18
for i in lis:
    #print(i,i[0],i[1])
    if tmp <= i[0]:
        count += 1
        tmp = i[1]

print(count)
#!/usr/bin/env python3
n = int(input())
xl = [list(map(int, input().split())) for _ in range(n)]
xl.sort()
x = [0] * n
l = [0] * n
for i in range(n):
    x[i], l[i] = xl[i]
ans1 = [True] * n
for i in range(n):
    if i > 0 and ans1[i - 1] and x[i - 1] + l[i - 1] > x[i] - l[i]:
        ans1[i] = False
ans2 = [True] * n
for i in range(n)[::-1]:
    if i < n - 1 and ans2[i + 1] and x[i] + l[i] > x[i + 1] - l[i + 1]:
        ans2[i] = False
print(min(sum(ans1), sum(ans2)))
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][0]
        ans += 1

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

for _ in range(N):
    x, l = map(int,input().split())
    T.append((x, l))

# sort by x
T.sort(key=lambda x: x[0])

lans = 1
llast = 0
for ix in range(1, N):
    if T[llast][0] + T[llast][1] <=  T[ix][0] - T[ix][1]:
        lans += 1
        llast = ix

rans = 1
rlast = N-1
for ix in range(N-2, -1, -1):
    if T[rlast][0] - T[rlast][1] >= T[ix][0] + T[ix][1]:
        rans += 1
        rlast = ix

print(max(lans, rans))
n = int(input())
l = []
for _ in range(n):
  x,y = map(int, input().split())
  l.append([x+y,x-y])
l.sort()

temp = l[0][1]
count = n
i = 1
while(i<n):
  if temp <= l[i][1]:
    i = i + 1
  else:
    temp = min(temp,l[i][1])
    count -= 1
    i = i + 1
print(count)
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 lr: (-lr[1], -lr[0]))
count = 0
cur = LR[0][0]
for l, r in LR[1:]:
    if cur < r:
        count += 1
    else:
        cur = l
print(n - count)
N = int(input())
X = list(list(map(int,input().split())) for _ in range(N))
X.sort()
check = N
ans = 0
for i in range(N):
    for j in range(1, N-1):
        # print(X[i][0] + X[i][1], X[j][0] - X[j][1])
        if X[i][0] + X[i][1] <= X[j][0] - X[j][1]:
            pass
        else:
            check -= 1
    ans = max(check, ans)
print(ans)
N = int(input())
left = [] 
right = []
for i in range(N):
    x, dis = map(int, input().split(" "))
    left.append(x-dis)
    right.append(x+dis)

left.sort()
right.sort()

cnt = 1
for i in range(N-1):
    if right[i] <= left[i+1]:
        cnt += 1

print(cnt)
import sys
inputs = sys.stdin.readlines()

n = int(inputs[0])
Y = []
for s in inputs[1:]:
    x, l = map(int, s.split())
    Y.append((x-l+1, x+l-1))
Y.sort(key=lambda x: x[0])

cnt = 0
_, r0 = Y[0]
for i in range(1, n):
    l, r = Y[i]
    if r0 < l:
        r0 = r
    else:
        cnt += 1
        if r0 >= r:
            r0 = r
print(n-cnt)
import sys
input = sys.stdin.readline
def main():
    N = int( input())
    X = []
    for _ in range(N):
        x, l = map( int, input().split())
        X.append((x+l-1, x-l+1))
    X.sort()
    ans = 0
    now = -10**9-1
    for i in range(N):
        b, a = X[i]
        if now < a:
            now = b
            ans += 1
    print(ans)
    
if __name__ == '__main__':
    main()
N=int(input())
R=[[1]*2 for _ in range(N)]
flag=0
for i in range(N):
    X,L=map(int,input().split())
    R[i][0]=X
    R[i][1]=L
R.sort()
for i in range(N-1):
    r=R[i][0]+R[i][1]
    l=R[i+1][0]-R[i+1][1]
    if r>l and flag==0:
        N-=1
        flag=1
    else:
        flag=0
print(N)
n = int(input())
data = [[]]*(n+2)
data[0] = [0, 0]
for i in range(1, n+1):
    x, l = map(int, input().split())
    data[i] = [max(0,x-l), x+l]
data[n+1] = [10**10, 10**10]
data.sort()
ans = n
for i in range(1, n):
    if data[i][1] > data[i+1][0] and data[i-1][1] > data[i][0]:
        ans -= 1
        data[i][0] = 0
        data[i][1] = 0

print(ans)
n = int(input())
ls = [(0, 0)] * n
for i in range(n):
    x, ln = map(int, input().split())
    l = x - ln
    r = x + ln
    ls[i] = (l, x)
#print(ls)

ls.sort(key=lambda x: x[1])
#print(ls)
last = -float('inf')
count = 0
for i in ls:
    if last <= i[0]:
        count += 1
        last = i[1]
print(count)
N = int(input())
S = [tuple(map(int, input().split())) for i in range(N)]
T = list(map(lambda j:(j[0]-j[1]+1, j[0]+j[1]-1), S))

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

for i, t in enumerate(T):
  if i>0:
    if end < t[0]:
      res += 1
      start = t[0]
      end = t[1]
  else:
    start = t[0]
    end = t[1]
    res = 1

print(res)
n = int(input())
t = [input().split() for i in range(n)]
t = [[int(i) for i in j] for j in t]
t = sorted(t)
delcount,counter = 0,t[0][0]+t[0][1]
for i in range(1,n):
	if counter > t[i][0] - t[i][1]:
		delcount+=1
	else:
		counter = t[i][0] + t[i][1]
p = n - delcount

delcount,counter = 0,t[n-1][0]+t[n-1][1]

for i in range(n-1,0,-1):
	if counter < t[i][0] + t[i][1]:
		delcount+=1
	else:
		counter = t[i][0] - t[i][1]
print(max(p,n - delcount))
N = int(input())
xl = [list(map(int, input().split())) for _ in range(N)]
xl.sort(key=lambda x: x[0])
cnt = 1
tmp1 = xl[0][0] + xl[0][1]
for i in range(1, N):
    tmp2 = xl[i][0] - xl[i][1]
    if tmp2 >= tmp1:
        cnt += 1
        tmp1 = xl[i][0] + xl[i][1]

print(cnt)
n = int(input())
xl = [[0, 0] for i in range(n)]
for i in range(n):
  xl[i] = list(map(int, input().split()))
xl.sort(key=lambda x:x[0])
haji = xl[0][0] + xl[0][1]
puted = 1
for i in range(1, n):
  if haji <= xl[i][0] - xl[i][1]:
    puted += 1
    haji = xl[i][0] + xl[i][1]
print(puted)
# -*- coding: utf-8 -*-
n = int(input())
xl = [list(map(int, input().split())) for _ in range(n)]
lr = sorted([[xl[i][0]-xl[i][1],xl[i][0]+xl[i][1]] for i in range(n)])

cnt = 1
cl = lr[0][0]
cr = lr[0][1]
for l,r in lr[1:]:
    if cr<=l:
        cr = r
        cl = l
        cnt += 1

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

array = [[0]*2 for i in range(N)] 

tmp = 0
for i in range(N):
    x, l = map(int, input().split())
    lower = x-l
    if x-l <= 0:
        lower = 0
    higher =  x+l

    array[i][0] = lower
    array[i][1] = higher

array.sort()
flg = 0
for i in range(len(array)-1):

    if flg == 1: continue
    if array[i+1][0] < array[i][1]:
        tmp += 1
        flg = 1
        continue
    flg = 0
print(len(array)-tmp)
N = int(input())
robots = []
for _ in range(N):
    x, l = map(int, input().split())
    robots.append((x-l, x+l))

robots.sort(key=lambda x: x[1])  # 終端を昇順ソート
# print(robots)
cnt = 0
last = -10**18  # 最初、最右のものははるか左側にあると考える
for left, right in robots:
    if left+1 > last-1:  # 残せるのであれば
        cnt += 1
        last = right
print(cnt)
n = int(input())
xl = sorted([list(map(int, input().split())) for _ in range(n)], key = lambda x: x[0]+x[1])

x, l = xl[0]
ans = n
for i in range(1, n):
    if x+l-1 <= xl[i][0]-xl[i][1]+1:
        x, l = xl[i]
    else:
        ans -= 1
print(xl)
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()

cnt = 0
for i in range(n-1):
    if L[i][1] > L[i+1][0]:
        cnt +=1
        L[i+1] =[-10**10,-10**10]
print(n-cnt)
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

n = int(readline())
xl = [list(map(int, readline().decode('utf-8').split())) for _ in range(n)]
LR = [(x - l, x + l) for x, l in xl]
LR.sort()

acc = -10**18

cnt = 0

for l, r in LR:
    if acc > l:
        continue
    cnt += 1
    acc = r

print(cnt)
n = int(input())
x = sorted([list(map(int, input().split())) for _ in range(n)])

if n == 1:
    print(1)
    exit()

cnt = n
l = 0
r = 1
for i in range(n):
    if x[l][0] + x[l][1] > x[r][0] - x[r][1]:
        cnt -= 1
        r += 1
    else:
        l = r
        r = l + 1
    if r >= n - 1:
        break
print(cnt)
N = int(input())
xl =[[int(x) for x in input().split()]for _ in range(N)]
xl = sorted(xl,key = lambda x:x[1])
xl = sorted(xl,key = lambda x:x[0])
minx=0
maxx=0
cnt=0
for i in range(N):
  mina=max(xl[i][0]-xl[i][1],0)
  maxa = xl[i][0]+xl[i][1]
  if maxx<=mina:
    maxx=maxa
  else:
    cnt+=1
print(N-cnt)
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])

ex_a = -1
count = 0

for a,b in robots:
  if b >= ex_a:
    ex_a = a
    count += 1
print(count)
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())
A = [list(map(int,input().split())) for i in list(range(N))]
B = [[i[0]+i[1], i[0]-i[1]] for i in A]
B.sort()
prev=B[0]
cnt=N
for i in range(1,N):
  if prev[0]<B[i][1]:
    cnt-=1
  else:
    prev=B[i]
print(cnt)
# -*- coding: utf-8 -*-

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

for i in range(N):
    tmp = list(map(int,input().split()))
    X.append((tmp[0],tmp[1]))

X.sort()
flag = []
cnt = 0
for i, t in enumerate(X):
    if i == 0:
        flag.append(1)
    if (X[cnt][0]+X[cnt][1] > t[0]-t[1]):
        flag.append(0)
    else:
        flag.append(1)
        cnt = i

print(sum(flag))
n=int(input())
l=list()
for i in range(n):
    l.append(list(map(int,input().split())))
l.sort(key=lambda x:x[0])
p=[1 for i in l]
for i in range(1,n):
    if p[i-1] and l[i-1][0]+l[i-1][1]>l[i][0]-l[i][1]:
        p[i]=0
        #print(i)
print(sum(p))
import numpy as np

stdin = np.fromstring(open(0).read(), np.int64, sep=' ')
N = stdin[0]
XL = stdin[1:].reshape(-1, 2).T
x = XL[0]
l = XL[1]
arg = np.argsort(x)
x = x[arg]
l = l[arg]

xr = x + l
xl = x - l

count = 0
i = 0
while i < N - 1:
    for j in range(i + 1, N):
        if xr[i] >= xl[j]:
            count += 1
        else:
            i = j
    else:
        break
print(N - count)
N = int(input())
ST = []
for i in range(N):
    x, l = list(map(int, input().split()))
    ST.append([x-l, x+l])
ST.sort(key = lambda x :x[1])
startT = ST[0][1]
ans = 1
if N != 1:
    for i in range(1,N):
        if startT >= ST[i][0]:
            continue
        else:
            startT = ST[i][1]
            ans += 1
print(ans)
import numpy as np

N = int(input())
R = []
for i in range(N):
  R += map(int, input().split())
R = np.array(R).reshape(N,2)

cnt = 0
for i in range(0,N-1,2):
  if np.abs(R[i+1,0] - R[i,0]) < (R[i+1,1] + R[i,1]):
    cnt += 1
print(N - cnt)
n=int(input())
x=[]
l=[]
for i in range(n):
    a,b=map(int,input().split())
    x.append(a)
    l.append(b)

ans = [[0 for i in range(2)] for j in range(n)]
for i in range(n):
    ans[i][1]=(x[i]+l[i])
    ans[i][0]=max(0,x[i]-l[i])
ans.sort()
count=1
j=0
for i in range(n-1):
    if ans[j][1]<=ans[i+1][0] :
        count+=1
        j=i+1
    else:
        if ans[i][1]>ans[i+1][1]:
           j=i+1  

print(count)
N = int(input())
XL = [list(map(int,input().split())) for i in range(N)]
XL.sort(key=lambda x: (x[0]+x[1],x[0]-x[1]))
M = XL[0][0]+XL[0][1]-1
ans = N
for i in range(1,N):
    if M >= XL[i][0]-XL[i][1]+1:
        ans -= 1
    else:
        M = XL[i][0]+XL[i][1]-1
print(ans)
import math
N = int(input())
X = []
for _ in range(N):
  x, l = map(int,input().split())
  X.append([x+l, x, l])
sorted_X = sorted(X, key=lambda x:(x[1], x[2]))
ans = 1
cnt = sorted_X[0][0]
for i in range(N):
  if sorted_X[i][1] - sorted_X[i][2] >= cnt:
    ans += 1
    cnt = sorted_X[i][0]
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 - 1, x - l + 1] for x, l in xl])

ans = 0
mr = xl2[0][1] - 1
for r, l in xl2:
    if l > mr:
        ans += 1
        mr = r
print(ans)
n = int(input())
x = sorted([list(map(int, input().split())) for _ in range(n)])

if n == 1:
    print(1)
    exit()

cnt = n
j = 0
for i in range(n):
    if x[j][0] + x[j][1] > x[j + 1][0] - x[j + 1][1]:
        cnt -= 1
        j += 1
    j += 1
    if j >= n - 1:
        break
print(cnt)
N = int(input())
XL = []
for _ in range(N):
    x, l = map(int, input().split())
    XL.append([x, l])
XL.sort()
ans = 1
prev = XL[0]
for i in range(1, N):
    x, l = XL[i]
    if x - prev[0] - 1  - (l + prev[1] -1 )>= 0:
        ans += 1
        prev = [x, l]
print(ans)
import numpy as np

N=int(input())
XL=[]
for i in range(N):
    XL.append(list(map(int,list(input().split()))))
XL=np.asarray(XL)
XLs=XL[np.argsort(XL[:,0])]
right=XLs[0][0]+XLs[0][1]
ans=1
for i in range(N-1):
    if right-(XLs[i+1][0]+XLs[i+1][1])>0:
        right=XLs[i+1][0]+XLs[i+1][1]
    elif XLs[i+1][0]-XLs[i+1][1]-right>=0:
        ans+=1
        right=XLs[i+1][0]-XLs[i+1][1]
print(ans)
N = int(input())
ST = []
for i in range(N):
    x, l = list(map(int, input().split()))
    ST.append([x-l+1, x+l-1])
ST.sort(key = lambda x :x[1])
startT = ST[0][1]
ans = 1
if N != 1:
    for i in range(1,N):
        if startT >= ST[i][0]:
            continue
        else:
            startT = ST[i][1]
            ans += 1
print(ans)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
xl = [list(map(int, readline().split())) for i in range(n)]
pm = [[0] * 2 for _ in range(n)]
for i in range(n):
    pm[i][0] = xl[i][0] + xl[i][1]
    pm[i][1] = xl[i][0] - xl[i][1]
pm.sort(key=lambda x: x[1])
ans = 1
check = pm[0][0]
for i in range(1, n):
    if check <= pm[i][1]:
        check = pm[i][1]
        ans += 1
print(ans)
N = int(input())
XL = [list(map(int,input().split())) for i in range(N)]
XL.sort(key=lambda x: (x[0]-x[1],x[0]+x[1]))
M = XL[0][0]+XL[0][1]-1
ans = N
for i in range(1,N):
    if M >= XL[i][0]-XL[i][1]:
        ans -= 1
    else:
        M = XL[i][0]+XL[i][1]-1
print(ans)
import numpy as np
n = int(input())
rs = [list(map(int, input().split())) for _ in range(n)]
rs = np.array(rs)
rs.sort(axis=0)

cnt = 0
reach = None
for i in range(n):
    x, l = rs[i]
    if reach is None:
        reach = x + l
    else:
        if x - l < reach:
            cnt += 1
        else:
            reach = x + l
print(n - cnt)
N = int(input())

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

arm = sorted(arm.items(), key=lambda x: x[1])
print(arm)

count = 0
i = -float("inf")
for item in arm:
    if item[0] < i:
        continue
    i = item[1]
    count += 1

print(count)
N = int(input())
XL = []
for i in range(N):
    XL.append(list(map(int, input().split())))
XL.sort()
i = 0
cnt = N
while i < N - 1:
    if XL[i][0] + XL[i][1] > XL[i + 1][0] - XL[i + 1][1]:
        cnt -= 1
        i += 1
    i += 1
print(cnt)
n = int(input())
x_l = []
for i in range(n):
    x,l = map(int,input().split())
    x_l.append([x-l,x+l])
x_l = sorted(x_l, key=lambda x:x[0])
ans = n
for i in range(n-1):
    if x_l[i][1] > x_l[i+1][0]:
        ans -= 1
        x_l[i+1] = x_l[i]
print(ans)
n = int(input())
d = []
left = []
right = []
for i in range(n):
    x,l = map(int, input().split())
    # num , left , right
    d.append([x-l+1,x+l-1])

d.sort()
p = d[0][1]
ans = n
for i in range(1,n):
    if d[i][0] <= p:
        ans -= 1
        p = min(p,d[i][1])
    else:
        p = d[i][1]
print(ans)
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 - 1):
    if last > LR[i][0]:
        if last > LR[i][1]:
            last = LR[i][1]
        ans -= 1
    else:
        last = LR[i][1]
print(ans)
### Keyence B

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

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

if N == 1:
    print(robot_count)
else:
    robot_list.sort()
    r = robot_list[0][1]
    
    for i in range(1, N):
        if r <= robot_list[i][0]:
            robot_count += 1
            r = robot_list[i][1]
    
    print(robot_count)
import numpy as np
n = int(input())
s = 0
d = 0
hanni = []
for i in range(n):
  a,b = map(int,input().split())
  hanni.append([np.clip(a-b,0,10**9),np.clip(a+b,0,10**9)])
hanni.sort(key=lambda x: x[1])
for i in range(n):
  if s != len(hanni)-1 and hanni[s][1] > hanni[s+1][0]:
    d += 1
    if d>=min(n-2,3):
      del hanni[s]
      d = 0
    else:
      s+=1
  else:
    s+=1
    d = 0
    
print(len(hanni))
n = int(input())
xs = []
scope = {}
for _ in range(n):
    x, l = map(int, input().split())
    xs.append(x)
    scope[x] = [x-l, x+l]
    
xs.sort()
ans = 1
end = scope[xs[0]][1]
for i in xs[1:]:
    start = scope[i][0]
    if end <= start:
        ans += 1
        end = start
print(ans)