peterverebics/CodeNet_Python_118 huggingface dataset:
N = int(input())
xl = [list(map(int, input().split())) for _ in range(N)]
rl = []
for i in range(N):
    rl.append((xl[i][0] - xl[i][1], xl[i][0] + xl[i][1]))
rl.sort(key=lambda x: x[1])
cnt = 0
tmp = -10 ** 18

for i, j in rl:
    if tmp <= i:
        cnt += 1
        tmp = j
print(cnt)
from collections import deque

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

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

p = deque(p)
ex = []
ex.append(p.popleft())




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

print(len(ex))
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 item: item[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())
a=[]
for i in range(n):
  x,l=map(int,input().split())
  a.append((x+l,2*l))
a.sort()
ans=1
x,l=a[0]
for i in range(1,n):
  xx,ll=a[i]
  if x<=xx-ll:
    ans+=1
    x,l=xx,ll
print(ans)
def solve():
  n = int(input())
  query  =[]
  for i in range(n):
    x,l = (int(i) for i in input().split())
    query.append((x+l,max(0,x-l)))
  query.sort()
  nowr = 0
  ans = 0
  for i in range(n):
    r,l = query[i]
    #print(nowr)
    if nowr <= l:
      nowr = r
      ans += 1
  print(ans)
solve()
n = int(input())
L = []
for i in range(n):
  a,b = map(int,input().split())
  L.append([a+b,a-b])
L.sort()
ans = 0
right = -10**10
for i in range(n):
  if L[i][1] >= right:
    ans += 1
    right = max(right,L[i][0])
print(ans)
n = int(input())
r = []
for i in range(n):
    x, l = map(int, input().split())
    r.append((x - l, x + l))
r.sort(key=lambda _x: _x[1])
cnt = 1
limit = r[0][1]
for ri in r[1:]:
    if ri[0] >= limit:
        cnt += 1
        limit = ri[1]
print(cnt)
n=int(input())
XL=[]
for i in range(n):
  x,l=map(int,input().split())
  XL.append([x-l,x,x+l])
ans=0
cur=-float("inf")
XL.sort(key=lambda x:x[2])
for x1,x2,x3 in XL:
  if x1>=cur:
    cur=x3
    ans+=1
  else:
    continue
print(ans)
n=int(input())
li=[list(map(int,input().split())) for i in range(n)]
for i in range(n):
  li[i].append(li[i][0]-li[i][1])
  li[i].append(li[i][0]+li[i][1])

from operator import itemgetter
li=sorted(li, key=itemgetter(3))

ans=0
now=0

for i in range(n-1):
  if li[now][3]>=li[i+1][3]: #今調査してるやつが、次のやつを覆ってしまってる場合
    ans+=1
    now=i+1
  elif li[now][3]>li[i+1][2]:
    ans+=1
  else:
    now=i+1

print(n-ans)
from operator import itemgetter
X = []
L = []

n = int(input())
for i in range(n):
    x, l = map(int, input().split())
    X.append(x)
    L.append(l)

robo = sorted([(X[i]-L[i], X[i]+L[i]) for i in range(n)], key=itemgetter(1))

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

print(ans)
from collections import deque
import sys
input = sys.stdin.readline
from heapq import heapify

N = int(input())

table = []

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

table.sort(key=lambda x:x[0])
cur = table[0]
for i in range(1,N):
    if table[i][0] < cur[1]:
        N -= 1
        if cur[1] >= table[i][1]:
            cur = table[i]
    else:
        cur = table[i]

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

xl.sort()

ans = N
rpre = xl[0][0] + xl[0][1]

for x, l in xl[1:]:
    ll = max(x - l, 0)
    rr = x + l
    if ll < rpre:
        ans -= 1
        if rr < rpre: rpre = rr
    else:
        rpre = rr

print(ans)
N = int(input())
arms = []
for i in range(0, N):
  X, L = map(int, input().split(" "))
  arms.append((X + L, X - L))

arms.sort()
ans = 0
coord = -float('inf')

for arm in arms:
  if arm[1] >= coord:
    ans += 1
    coord = arm[0]

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

R=[]
for i in range(N):
    x,l=map(int,input().split())
    s=x-l
    t=x+l
    R.append([s,t])
R.sort(key=lambda x:x[1])
cur=-10**9
ans=0
for i in range(N):
    if cur<=R[i][0]:
        ans+=1
        cur=R[i][1]
print(ans)
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)
n = int(input())
ll = []
for i in range(n):
  x, l = map(int, input().split())
  ll.append([x-l, x+l])
ll = sorted(ll, key=lambda x: x[1])

ans = 0
tmp = -10**9

for s, t in ll:
  if s >= tmp:
    ans += 1
    tmp = t

print(ans)
n = int(input())
xl = [list(map(int, input().split())) for _ in range(n)]

lr = []
for i in range(n):
    l = max(xl[i][0] - xl[i][1], 0)
    r = max(xl[i][0] + xl[i][1], 0)
    lr.append([l, r])

lr.sort(key=lambda x: x[1])
keep = [False] * n


cur = 0
for i in range(n):
    if cur <= lr[i][0]:
        keep[i] = True
        cur = lr[i][1]

ans = sum(keep)
print(ans)
N=int(input())
X=[[0,0]]*N
for i in range(N):
    X[i]=list(map(int,input().split()))
X.sort()
right=X[0][0]+X[0][1]
count=0
for i in range(1,N):
    if right>X[i][0]-X[i][1]:
        count+=1
        right=min(X[i][0]+X[i][1],right)
    else:
        right=X[i][0]+X[i][1]
print(N-count)
N = int(input())
R = []
for _ in range(N):
    X, L = map(int, input().split())
    l, r = X-L, X+L
    R.append([l, r])

R = sorted(R, key=lambda x: x[1])
tmp = R[0]
ans = [R[0]]
for i in range(1, N):
    v = R[i]
    if tmp[1] <= v[0]:
        ans.append(v)
        tmp = v

print(len(ans))
n = int(input())
robots = []
for i in range(n):
    x,l = map(int,input().split())
    robots.append((x+l,x-l))
robots.sort()
count = 1
cur = robots[0][0]
for i in range(1,n):
    if robots[i][1] >= cur:
        cur = robots[i][0]
        count += 1
print(count)
N=int(input())
L=[]
for i in range(N):
    a,b=map(int,input().split())
    L.append([a+b,a-b])
L.sort()
#print(L)
ans=0
X=-10**9
for i in range(N):
    if L[i][1]>=X:
        ans+=1
        X=L[i][0]
print(ans)
# -*- coding: utf-8 -*-


def main():
    n = int(input())
    y = list()

    for i in range(n):
        xi, li = map(int, input().split())
        # y.append((xi - li + 1, xi + li - 1))
        y.append((xi - li, xi + li))

    count = 1
    sorted_y = sorted(y, key=lambda x: x[1])
    end_point = sorted_y[0][1]

    for left, right in sorted_y[1:]:
        if left >= end_point:
            end_point = right
            count += 1

    print(count)


if __name__ == '__main__':
    main()
n=int(input())
import heapq
q=[]

for i in range(n):
    x,l=map(int,input().split())
    heapq.heappush(q,(x+l,l))

largest=-float('inf')
c=0
while q:
    a,l=heapq.heappop(q)
    if largest<=a-2*l:
        largest=a
        c+=1
print(c)
N = int(input())
A = [[] for _ in range(N)]
for i in range(N):
  x, l = map(int, input().split())
  A[i] = [x + l, x - l]
A.sort()
for i in range(N):
  A[i][0], A[i][1] = A[i][1], A[i][0]
M = A[0][1]
cnt = 1
for i in range(1, N):
  if M <= A[i][0]:
    cnt += 1
    M = A[i][1]
print(cnt)
from operator import itemgetter

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

for i in range(n):
    x = XLs[i][0]
    l = XLs[i][1]
    XLs[i].append(x+l)

#右手の端の位置でソート
XLs.sort(key=itemgetter(2))

choice = -10**10
cnt = 0
for i in range(n):
    x = XLs[i][0]
    l = XLs[i][1]

    if choice <= x-l:
        choice = x+l
        cnt += 1

print(cnt)
N, *XL = map(int, open(0).read().split())

A = sorted(((x + l, x - l) for x, l in zip(*[iter(XL)] * 2)), key=lambda x: x[0])

ans = 0
cur = -10 ** 9
for t, s in A:
    if cur <= s:
        cur = t
        ans += 1

print(ans)
# -*- coding: utf-8 -*-

n = int(input())
a = []
b = []
b2 = []
c = []
count = 0
max = 0

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

a.sort(key=lambda x: x[2])

for i in a:
    if max != 0 and i[0]-i[1] < max:
        count += 1
    else:
        max = i[2]
    
print(n - count)
N = int(input())

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

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

ans = 0
cur = -1e9
for i in range(N):
    S, T = ST[i]
    if cur <= S:
        ans += 1
        cur = T
print(ans)
n=int(input())
a = [list(map(int, input().split())) for i in range(n)]

for i in range(n):
    a[i].append(a[i][0]-a[i][1])
    a[i].append(a[i][0]+a[i][1])

a.sort(key=lambda x: x[3])

left=-float('inf')
count=0
for i in range(n):
    if a[i][2]>=left:
        count+=1
        left=a[i][3]

print(count)
n = int(input())
robot = [0]*n
for i in range(n):
  a, b = map(int, input().split())
  robot[i] = [a+b, a-b]

robot.sort()
ans = 0
for i in range(n):
  if i == 0:
    key = robot[0][0]
    ans += 1
    continue
  if robot[i][1] < key:
    continue
  key = robot[i][0]
  ans += 1
print(ans)
N = int(input())
table = []
for i in range(N):
    X,L = map(int,input().split())
    table.append((X-L,X+L))
table = sorted(table, key=lambda x:x[1])

cur = 0
l_cur, r_cur = table[0]
ans = N
for i in range(1,N):
    l,r = table[i]
    if r_cur > l:
        ans -= 1
    else:
        l_cur, r_cur = l,r
print(ans)
def solve():
    n = int(input())
    x, l = [0]*n, [0]*n
    for i in range(n):
        x[i], l[i] = map(int, input().split())
    hoge = []
    for i in range(n):
        hoge.append([x[i]+l[i], x[i]-l[i]])
    hoge.sort()
    t = -1000000000000000000000
    ans = 0
    for i in range(n):
        if t <= hoge[i][1]:
            ans += 1
            t = hoge[i][0]
    print(ans)
    return 0
 
if __name__ == "__main__":
    solve()
N = int(input())
LR = [[0,0] for _ in range(N)]
for i in range(N):
  a,b = map(int, input().split())
  LR[i] = [a-b,a+b]

LR.sort(key=lambda x: x[0])
# print(LR)
prev_right = - 10**9 #一つ前の右端
cnt = 0
for i in range(N):
  if LR[i][0]>=prev_right: #次の左端が前の右端以上なら
    cnt += 1
    prev_right = LR[i][1]
  else:
    if LR[i][1]<prev_right:
      prev_right = LR[i][1]
  # print(prev_right)

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

ans = 0
last = -1e10
for r, l in R:
    if last <= l:
        ans += 1
        last = r
print(ans)
import numpy as np


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

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

b = []
e = []
for i in np.argsort(ends):
    b.append(begins[i])
    e.append(ends[i])
begins = b
ends = e

now = -1e9
cnt = 0
for i in range(N):
    if now <= begins[i]:
        cnt += 1
        now = ends[i]

print(cnt)
import math

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[0])
li.sort(key=lambda x:x[1])

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

print(ans)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from operator import itemgetter

# 区間スケジューリング

N = int(readline())
m = map(int,read().split())
XL = zip(m,m)

LR = [(x-l,x+l) for x,l in XL]
LR.sort(key = itemgetter(1))

INF = 10 ** 18
prev_R = -INF
cnt = 0
for L,R in LR:
    if prev_R > L:
        continue
    cnt += 1
    prev_R = R

print(cnt)
N=int(input())
X=[0]*N
L=[0]*N
t=[0]*N

for i in range(N):
  X[i],L[i]=map(int,input().split())
  t[i]=[X[i]-L[i], X[i]+L[i]]
  
t.sort(key=lambda x:x[1])
#print(t)

pos=float("-inf")
cnt=0
for arm in t:
  if pos<=arm[0]:
    cnt +=1
    pos=arm[1]
    
print(cnt)
H = int(input())
x = [[float('inf')]*2 for i in range(H)]

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

from operator import itemgetter
sf = sorted(x, key=itemgetter(1))

ans = 0
last = float('inf')*-1

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

print(ans)
N = int(input())
R = sorted([list(map(int, input().split())) for i in range(N)])
T = []
for i in range(N):
    T.append([R[i][0] + R[i][1], R[i][0] - R[i][1]])
T.sort(reverse=True)
while len(T) - 1 > 0:
    t = T.pop()
    i = 1
    while len(T) and t[0] > T[-1][1]:
        N -= 1
        i += 1
        T.pop()
print(N)
from collections import deque
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])
L = deque(L)
s, ans = -10**8, 0
while L:
  l = deque.popleft(L)
  if s<=l[0]:
    ans += 1
    s = l[1]
print(ans)
def b_robot_arms():
    from operator import itemgetter
    N = int(input())
    Robots = [[int(i) for i in input().split()] for j in range(N)]

    robot_arms = sorted([[x - l, x + l] for x, l in Robots], key=itemgetter(1))
    current = -float('inf')
    ans = 0
    for left, right in robot_arms:
        if current <= left:
            ans += 1
            current = right
    return ans

print(b_robot_arms())
n=int(input())

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

cnt=0
min=-10**18

for r,l in list:
 if min<=r:
  cnt+=1
  min=l
print(cnt)
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, r)
#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())
pos_list = []
for _ in range(N):
    X, L = map(int, input().split())
    pos_list.append([X + L, X - L])
sorted_data = sorted(pos_list)
# print(pos_list)
ans = 0
current = -(10 ** 9)
for val in sorted_data:
    if current <= val[1]:
        ans += 1
        current = val[0]
print(ans)
n = int(input())
 
lines = []
for i in range(n):
  x,l = map(int,input().split())
  lines.append([x-l,x+l])
lines = sorted(lines,key=lambda x:x[1])
count = 0
kari = -9999999999999
for i in range(n):
  if lines[i][0] >= kari:
    count += 1
    kari = lines[i][1]
print(count)
import sys
N = int(input())
a = sorted([(x + l, x - l) for x, l in (map(int, l.split()) for l in sys.stdin)])

last = a[0][0]
ans = 1

for r, l in a[1:]:
    if last <= l:
        ans += 1
        last = r

print(ans)
n = int(input())
arm = []
for _ in range(n):
    x, l = map(int,input().split())
    arm.append([x-l, x+l])
arm.sort(key=lambda x: x[1])
cnt = 0
pr = -float('inf')
for a in arm:
    if pr <= a[0]:
        cnt += 1
        pr = a[1]
print(cnt)
N = int(input())
a = []
for _ in range(N):
    x,l = map(int,input().split())
    a.append([x-l,x+l])
a.sort()
ans = 0 
right = -1*1000000000000
for i in a:
    if i[0] >= right:
        ans += 1
        right = i[1]
    else:
        if right > i[1]:
            right = i[1]
print(ans)
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())
r = [list(map(int, input().split())) for _ in range(N)]
a = []
for i in r:
    a.append((i[0]-i[1],i[0]+i[1]))
a.sort(key=lambda x:x[1])
ans = 0
cur = -float('inf')
for i in a:
    if i[0] < cur:
        continue
    ans += 1
    cur = i[1]
print(ans)
N = int(input())
TS = []
for i in range(N):
    X, L = map(int, input().split())
    TS.append((X + L, X - L))
TS = sorted(TS)
cur = -10**10
ans = 0
for i in range(N):
    if cur <= TS[i][1]:
        ans += 1
        cur = TS[i][0]
print(ans)
def main():

    N = int(input())
    interval = []
    for _ in range(N):
        X, L = map(int, input().split())
        interval.append([X-L, X+L])
    interval.sort()
    cnt = 0
    i = 0
    while i < N:
        a, b = interval[i]
        cnt += 1
        i += 1
        while i < N and interval[i][0] < b:
            if interval[i][1] < b:
                a, b = interval[i]
            i += 1
    return cnt


if __name__ == '__main__':
    print(main())
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
    if s >= right:
        right = t
        ans += 1
print(ans)
n=int(input())
Range=[]
ans,end=0,-1*(10**9+1)
for i in range(n):
  x,y=list(map(int,input().split()))
  Range.append([x-y,x+y])
Range.sort(key=lambda X: X[1])

for R in Range:
  if end <= R[0]:
    ans += 1
    end=R[1]
  else:
    continue
print(ans)
N = int(input())
robot = [list(map(int,input().split())) for _ in range(N)]

L = [[0,0] for _ in range(N)]
for i in range(N):
    L[i][0] = robot[i][0]-robot[i][1]
    L[i][1] = robot[i][0]+robot[i][1]-1

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

a = 0
b = -float('inf')

for i in range(N):
    if b < L[i][0]:
        a += 1
        b = L[i][1]

print(a)
N = int(input())
A = []
for i in range(N):
    x,l = map(int,input().split())
    A.append([x-l,x+l])
B=sorted(A,key=lambda x: x[1])
s = B[0][1]
n = 1
for i in range(1,N):
    a = B[i][0]
    b = B[i][1]
    if a >= s:
        n += 1
        s = b
print(n)
N = int(input())
MAX_list = []
ans = 0
A = -10**9-2

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

for m, l in MAX_list:
    if l >= A:
        ans += 1
        A = m

print(ans)
import sys
input = sys.stdin.readline  #文字列入力では注意！
from bisect import bisect
N = int(input())
XL = [list(map(int,input().split())) for _ in range(N)]
S = []
for x,l in XL:
    S.append([x-l,x+l])

S.sort(key=lambda x: x[1])
ans = 1
mi = S[0][1]
for i in range(1,N):
    if mi <= S[i][0]:
        mi = S[i][1]
        ans += 1
print(ans)
N = int(input())
arms = []
ans = 1
for i in range(N):
    X,L = (int(x) for x in input().split())
    arms.append((X-L,X+L))
arms.sort(key=lambda x:x[1])
limit = arms[0][1]
for x in arms[1:]:
    if x[0] < limit:
        continue
    else:
        limit = x[1]
        ans += 1
print(ans)
n = int(input())
X = []
for i in range(n):
  x, l = map(int, input().split())
  X.append([x-l, x+l])
X.sort()
temp = X[0][1]
count = n
for i in range(1,n):
  if temp>X[i][0]:
    count -= 1
    temp = min(temp, X[i][1])
  else:
    temp = X[i][1]
print(count)
N = int(input())
X = [list(map(int, input().split())) for _ in range(N)]

S = [[x - l, x + l] for x, l in X]
S.sort(key=lambda x: x[1])

ans = 0
tmp = -10 ** 12
for x, y in S:
    if tmp <= x:
        ans += 1
        tmp = y
        
print(ans)
n=int(input())
X=[]
for i in range(n):
    x,l=[int(_) for _ in input().split()]
    X+=[(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())
li=[None]*n
for i in range(0,n):
    flag=True
    x,l=map(int, input().split())
    li[i]=(x+l, x-l)
li=sorted(li)
count=1
x,y=li[0]
for i in range(1,n):
    x2,y2=li[i]
    if y2 < x:
        continue
    count=count+1
    x=x2
print(count)
n = int(input())
a = []
for _ in range(n):
    c0, c1 = map(int, input().split())
    a.append([c0-c1, c0+c1])
a.sort(key=lambda x: x[1])
ans, b = 1, a[0][1]
for i in a[1:]:
    if b <= i[0]:
        b = i[1]
        ans += 1
print(ans)
def main():
    N = int(input())
    L = []
    for i in range(N):
        xi, li = map(int, input().split())
        s = xi - li
        f = xi + li
        L.append((f, s))
    
    L.sort()

    ans = 0
    finish = -float("inf")
    for i in L:
        if finish <= i[1]:
            ans += 1
            finish = i[0] 

    print(ans)

if __name__ == "__main__":
    main()
def main():
    N = int(input())

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

    r = -10**10
    ans = 0
    for s in S:
        if s[0] >= r and s[1] >= r:
            r = s[1]
            ans += 1

    print(ans)

if __name__ == '__main__':
    main()
n = int(input())
x = [list(map(int, input().split())) for i in range (n)]

grid = [list([0,0]) for i in range(n)]

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

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

cnt = 1
a = new_grid[0][1]

for i in range(n):
    if a <= new_grid[i][0]:
        cnt += 1
        a = new_grid[i][1]
print(cnt)
n = int(input())
s = []
t = []
for i in range(n):
    xa,la = map(int,input().split())
    s.append(xa-la)
    t.append(xa+la)
#print(s)
#print(t)

itv = []
for i in range(n):
    itv.append([t[i],s[i]])
itv.sort()

#print(itv)
ass = 0
tt = -1000000000
for i in range(n):
    if tt <= itv[i][1]:
        ass += 1
        tt = itv[i][0]
print(ass)
n = int(input())
A = []
for i in range(n):
    x, l = map(int, input().split())
    a = x - l
    b = x + l
    A.append((a, b))
A = sorted(A, key = lambda x:x[1])
cnt = 0
right = -float('inf')
for i in range(n):
    if right <= A[i][0] :
        cnt += 1
        right = A[i][1]
print(cnt)
n = int(input())
x=[0]*n
l=[0]*n
t=[0]*n
for i in range(n):
    x[i],l[i]=map(int,input().split())
    t[i]=[x[i],l[i]]
t=sorted(t,key=lambda x:x[0]+x[1])
right=t[0][0]+t[0][1]
count=1
for i in range(1,n):
    if t[i][0]-t[i][1]>=right:
        count+=1
        right=t[i][0]+t[i][1]
print(count)
N = int(input())
R = []
for _ in range(N):
    x, L = map(int, input().split())
    R.append([x - L, x + L])

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

ans = 1
for i in range(N):
    if (i == 0):
        first = R[0][1]
        continue

    if first <= R[i][0]:
        first = R[i][1]
        ans += 1

print(ans)
n = int(input())
li_a = []
for i in range(n):
  a = list(map(int, input().split()))
  li_a.append(a)
li = list(sorted(li_a))
ans = 0
b = li[0][0] + li[0][1]
for i in range(n-1):
  if li[i+1][0] - li[i+1][1] >= b:
    b = li[i+1][0] + li[i+1][1]
  else:
    b = min(b, li[i+1][0]+li[i+1][1])
    ans += 1
print(n-ans)
N = int(input())
xl = []
for i in range(N):
    x, l = map(int, input().split())
    xl.append((x, l))
xl.sort()

kept = []
cur = 0
for i in range(1, N):
    x_cur, l_cur = xl[cur]
    x_next, l_next = xl[i]
    if x_cur + l_cur <= x_next - l_next:
        kept.append(cur)
        cur = i
    elif x_cur + l_cur > x_next + l_next:
        cur = i
kept.append(cur)

print(len(kept))
import sys
input = sys.stdin.readline

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

for i in range(n):
    A.append([L[i][0]-L[i][1], L[i][0]+L[i][1]])
A.sort(key=lambda x:x[1])

m = -float("inf")
ans = 0
for i in range(n):
    if m > A[i][0]:
        ans += 1
    else:
        m = A[i][1]
print(n-ans)
N = int(input())
xl = [0] * N
for i in range(N):
  x, l = map(int ,input().split())
  a = x - l
  b = x + l
  xl[i] = [a, b]
  
xl = sorted(xl, key = lambda x:x[1])

ans = 0
now = 0
for i in range(N):
  if i == 0:
    ans += 1
    now = xl[0][1]
  else:
    if xl[i][0] >= now:
      ans += 1
      now = xl[i][1]
      
print(ans)
N = int(input())
X = [0]*N
for i in range(N):
    X[i] = [0]*2
    x, l = map(int, input().split())
    X[i][1] = x - l
    X[i][0] = x + l
X = sorted(X)
nowplace = X[0][0]
ans = 1
for j in range(1, N):
    if nowplace <= X[j][1]:
        ans += 1
        nowplace = X[j][0]

print(ans)
n = int(input())
xl = [list(map(int, input().split())) for _ in range(n)]
le = [[p[0]-p[1], p[0]+p[1]] for p in xl]
le.sort(key = lambda x : x[1])

ans = 0
right = -(10 ** 9) - 1
for i in range(n):
    if right <= le[i][0]:
        ans += 1
        right = le[i][1]
print(ans)
def resolve():
    n = int(input())
    a = []

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

    t = -float('inf')
    a.sort(key=lambda x: x[1])
    ans = 0

    for start_t, end_t in a:
        if t <= start_t:
            ans += 1
            t = end_t

    print(ans)

resolve()
N = int(input())
r = [list(map(int, input().split())) for _ in range(N)]
a = []
for i in r:
    a.append((i[0]+i[1],i[0]-i[1]))
a.sort()
ans = 0
cur = a[0][1]
for i in a:
    if i[1] < cur:
        continue
    ans += 1
    cur = i[0]
print(ans)
n = int(input())
robots = []
for _ in range(n):
  x, l = map(int, input().split())
  robots.append((x+l, x-l))
robots.sort()

hand = robots[0][0]
count = 1
for robot in robots[1:]:
  if hand <= robot[1]:
    hand = robot[0]
    count += 1
print(count)