CodeEff/ECCO huggingface dataset:
# Original solution
from operator import itemgetter

N = int(eval(input()))
X=[]
ans=0
for i in range(N):
    H = list(map(int, input().split()))
    O=[]
    O.append(H[0]-H[1])
    O.append(H[0]+H[1])
    X.append(O)
#print(X)
X=sorted(X, key=itemgetter(1))
while(len(X)>0):
    #print(X)
    ans+=1
    S=X[0][1]
    X.remove(X[0])
    I = []
    for i in range(len(X)):
        if(X[i][0]>=S):
            I.append(X[i])
    X=I
    #print(I)



print(ans)


# Optimized solution
from operator import itemgetter

N = int(eval(input()))
X=[]
ans=0
for i in range(N):
    H = list(map(int, input().split()))
    O=[]
    O.append(H[0]-H[1])
    O.append(H[0]+H[1])
    X.append(O)
#print(X)
X=sorted(X, key=itemgetter(1))
S=X[0][1]
ans+=1
for i in range(len(X)):
    if(X[i][0]>=S):
        ans+=1
        S=X[i][1]
"""
while(len(X)>0):
    #print(X)
    ans+=1
    S=X[0][1]
    X.remove(X[0])
    I = []
    for i in range(len(X)):
        if(X[i][0]>=S):
            I.append(X[i])
    X=I
    #print(I)
"""


print(ans)
# Original solution
N = int(eval(input()))

xl = []

for i in range(N):
    xl.append(list(map(int,input().split())))

itv = []

for i in range(N):
    right = xl[i][0] + xl[i][1] - 0.01 ##right
    left = xl[i][0] - xl[i][1] + 0.01 ##left   
    itv.append([right,left])
itv.sort()

ass = 0
tt = -1e10
for i in range(N):
    if tt < itv[i][1]:
        ass += 1
        tt = itv[i][0]
print(ass)

# Optimized solution
N = int(eval(input()))

xl = []

for i in range(N):
    xl.append(list(map(int,input().split())))

itv = []

for i in range(N):
    right = xl[i][0] + xl[i][1]  ##right
    left = xl[i][0] - xl[i][1]  ##left   
    itv.append([right,left])
itv.sort()

ass = 0
tt = -1e10
for i in range(N):
    if tt <= itv[i][1]:
        ass += 1
        tt = itv[i][0]
print(ass)
# Original solution
n = int(eval(input()))
m_list = []
for i in range(n):
  X, L = list(map(int, input().split()))
  m_list.append([X-L,X+L])
 
m_list = sorted(m_list, key=lambda x:x[1])
  
def MachineArrangementCheck():
  length = len(m_list)
  # 配列の上限エラー対策
  for i in range(length):
    if i != length - 1:      
      # m1の上限とm２の下限が接するかを確認
      if (m_list[i+1][0] - m_list[i][1]) < 0:
        del m_list[i+1]
        return False
  return True
 
while MachineArrangementCheck() == False:
  continue
  
print((len(m_list)))

# Optimized solution
n = int(eval(input()))
m_list = []
for i in range(n):
    x,l = list(map(int, input().split()))
    m_list.append([x-l, x+l])

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

result = 0
cur_pos = -1000000000

for min,max in m_list:
    if cur_pos <= min:
        result += 1
        cur_pos = max
print(result)
# Original solution
# https://atcoder.jp/contests/keyence2020/tasks/keyence2020_b

N = int(eval(input()))
X, L = [], []

for i in range(N):
    x, l = list(map(int, input().split()))
    X.append([x, l])
    X.sort(key=lambda x: x[0], reverse=False)

L = [x[1] for x in X]
X = [x[0] for x in X]

ans = 0
cur = -float('inf')
for i in range(N):
    if (cur <= X[i] - L[i]):
        ans += 1
        cur = X[i] + L[i]
print(ans)

# Optimized solution
import sys
N = int(eval(input()))
a = sorted([(x + l, x - l) for x, l in (list(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)
# Original solution
N = int(eval(input()))
XL = [tuple(map(int, input().split())) for i in range(N)]

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

hold = [XL[0]]

ans = 1
for i in range(1, N):
    if hold[-1][0] + hold[-1][1] > XL[i][0] - XL[i][1]:
        if hold[-1][0] + hold[-1][1] < XL[i][0] + XL[i][1]:
            continue
        else:
            hold.append(XL[i])
    else:
        ans += 1
        hold.append(XL[i])

print(ans)

# Optimized solution
N = int(eval(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)
# Original solution
import math , sys
N = int( eval(input()) )

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


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

Y = X.pop(0)
Ri = Y[-1]
ans = 1

j=0

while len(X)>0:
    Y = X.pop(0)
    if Y[1]>=Ri:
        ans+=1
        Ri = Y[-1]
print(ans)


# Optimized solution
import math , sys
N = int( eval(input()) )

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


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

Y = X[0]
Ri = Y[-1]
ans = 1

j=0

for i in range(1,N):
    Y = X[i]
    if Y[1] >= Ri:
        ans+=1
        Ri = Y[-1]
print(ans)
# Original solution
N = int(eval(input()))
LR = [[int(i) for i in input().split()] for _ in range(N)]

# 区間を右端の小さい順にソート
LR = sorted([(x-l, x+l) for x,l in LR],key=lambda x: x[1])

ans = 0
# 現在選んでいる区間の内、最も右にある区間の右端
cur_R = -float("inf")

for i in range(N):
    # 区間が被るとき
    if cur_R > LR[i][0]:
        continue
    ans += 1
    cur_R = LR[i][1]

print(ans)

# Optimized solution
import sys
input = sys.stdin.readline

def main():
    N = int(eval(input()))
    LR = [[int(i) for i in input().split()] for _ in range(N)]

    # 区間を右端の小さい順にソート
    LR = sorted([(x-l, x+l) for x,l in LR],key=lambda x: x[1])

    ans = 0
    # 現在選んでいる区間の内、最も右にある区間の右端
    cur_R = -float("inf")

    for i in range(N):
        # 区間が被るとき
        if cur_R > LR[i][0]:
            continue
        ans += 1
        cur_R = LR[i][1]

    print(ans)

if __name__ == "__main__":
    main()
# Original solution
def trush(XL):
    pt,output = 1,len(XL)
    while pt < len(XL)-1:
        if XL[pt-1][2] > XL[pt][1] and XL[pt][2] > XL[pt+1][1]:
            XL = XL[:pt] + XL[pt+1:]
            output -= 1
        else:
            pt += 1

    pt = 0
    while pt < len(XL)-1:
        if XL[pt][2] > XL[pt+1][1]:
            if XL[pt][0]-XL[pt][1] > XL[pt+1][0]-XL[pt+1][1]:
                XL = XL[:pt] + XL[pt+1:]
            else:
                XL = XL[:pt+1] + XL[pt+2:]
            output -= 1
        else:
            pt += 1

    return output

def main():
    N = int(eval(input()))
    XL = [list(map(int,input().split())) for _ in range(N)]
    for i in range(N):
        XL[i] = [XL[i][0],XL[i][0]-XL[i][1],XL[i][0]+XL[i][1]]
    XL.sort(key = lambda x:x[0])
    
    ans = trush(XL)
    print(ans)

if __name__ == "__main__":
    main()


# Optimized solution
def cal(XL):
    N = len(XL)
    XL.sort(key = lambda x:x[0])
    for i in range(N):
        XL[i] = [XL[i][0],XL[i][0]-XL[i][1],XL[i][0]+XL[i][1]]
    OP = [XL[0]]

    for i in range(1,N):
        if OP[len(OP)-1][2] > XL[i][1]:
            if OP[len(OP)-1][2] < XL[i][2]:
                #右方向により腕が伸びている方がより邪魔
                pass
            else:
                OP.pop()
                OP.append(XL[i])
        else:
            OP.append(XL[i])

    return len(OP)

def main():
    N = int(eval(input()))
    XL = [list(map(int,input().split())) for _ in range(N)]
    ans = cal(XL)
    print(ans)

if __name__ == "__main__":
    main()
# Original solution
n=int(eval(input()))
L=[]
for i in range(n):
    x,l=list(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)
        

# Optimized solution
n=int(eval(input()))
 
L=[]
for i in range(n):
    x,l=list(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)
# Original solution
n=int(eval(input()))

robotLEFT=[]
robotRIGHT={}

for _ in range(n):
    x,l=list(map(int,input().split()))
    if x-l not in robotLEFT:
        robotLEFT.extend([x-l])
        robotRIGHT[x-l]=x+l
    else:
        robotRIGHT[x-l]=min(robotRIGHT[x-l],x+l)

robotLEFT.sort()
#print(robotRIGHT)
#print(robotLEFT)

temp=robotLEFT[0]
LL=temp-2
RR=temp-1
cnt=0

for item in robotLEFT:
    #print(LL,RR,cnt)
    if RR<=item:
        cnt+=1
        LL=item
        RR=robotRIGHT[LL]
    else:
        if RR>=robotRIGHT[item]:
            RR=robotRIGHT[item]
            LL=item
print(cnt)




# Optimized solution
n=int(eval(input()))

robot=[]

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



RR=robot[0][0]-1
cnt=0

for item in robot:
    if RR<=item[0]:
        cnt+=1
        RR=item[1]
    elif RR>=item[1]:
        RR=item[1]

print(cnt)
# Original solution
n = int(eval(input()))
a = []
for _ in range(n):
    a.append(list(map(int,input().split())))

d = [[a[i][0]-a[i][1],a[i][0]+a[i][1]] for i in range(n)]

d = sorted(d, key = lambda x: x[1])
#print(d)

b = [-100000000000000000]
c = [0]


for i in range(n):
    for j in range(len(b)):
        if d[i][0] >= b[j]:
            if d[i][1] in b:
                c[b.index(d[i][1])] = c[j] + 1
            else:
                b.append(d[i][1])
                c.append(c[j]+1)
    
#print(b)
#print(c)

print((max(c)))
        
    


# Optimized solution
n = int(eval(input()))
a = []
for _ in range(n):
    a.append(list(map(int,input().split())))

d = [[a[i][0]-a[i][1],a[i][0]+a[i][1]] for i in range(n)]

d = sorted(d, key = lambda x: x[1])
#print(d)

b = [-100000000000000000]
c = [0]


for i in range(n):
    for j in range(len(b)):
        if d[i][0] >= b[j]:
            b = [d[i][1]]
            c = [c[j] + 1]
            break

    
    #print(b)
    #print(c)

print((max(c)))
# Original solution
N=int(eval(input()))
XL=sorted([list(map(int,input().split())) for i in range(N)],key=sum)
count=0
left=-10**9
for x,l in XL:
    if left<=x-l:
        count+=1
        left=x+l
print(count)

# Optimized solution
N=int(eval(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)
# Original solution
n = int(eval(input()))
ls = []
for i in range(n):
    x,l = list(map(int,input().split()))
    ls.append([x-l,l+x])
    
r = n
ls = sorted(ls, key=lambda item: item[1])
for i in range(1,n):
    if ls[i][0] < ls[i-1][1]:
      ls[i][1] = ls[i-1][1]
      r -=1
        
print(r)

# Optimized solution
n = int(eval(input()))
ls = []
for i in range(n):
    x,l = list(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)
# Original solution
n = int(eval(input()))
ls = []
for i in range(n):
    x,l = list(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)

# Optimized solution
n = int(eval(input()))
ls = []
for i in range(n):
    x,l = list(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)
# Original solution
from functools import reduce
N = int(eval(input()))
XL = [list(map(int,input().split())) for _ in range(N)]
area = sorted([[x-l,x+l] for x,l in XL], key=lambda x: x[1])
area_ = [area[0]]
for i in range(1,N):
  if reduce(lambda x,y: x and (area[i][0]>=y[1]), area_, True):
    area_.append(area[i])
print((len(area_)))

# Optimized solution
N = int(eval(input()))
XL = sorted([list(map(int,input().split())) for _ in range(N)], key=lambda x: x[0]+x[1])
n = 1
S_,T_ = XL[0][0]-XL[0][1], XL[0][0]+XL[0][1]
for i in range(1,N):
  S,T = XL[i][0]-XL[i][1], XL[i][0]+XL[i][1]
  if not (S < T_):
    n += 1
    S_,T_ = S,T
print(n)
# Original solution
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(eval(input()))
def MAP()   : return list(map(int,input().split()))
def LIST()  : return list(MAP())

n = INT()
x = [[0]*2 for i in range(n)]
for i in range(n):
    x[i][0], x[i][1] = MAP()

x.sort()
tmp = -inf
ans = n
for i in range(n):
    if tmp > x[i][0] - x[i][1]:
        ans -= 1
        tmp = min(tmp, x[i][0] + x[i][1])
    else:
        tmp = x[i][0] + x[i][1]
print(ans)

# Optimized solution
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(eval(input()))
def MAP()   : return list(map(int,input().split()))
def LIST()  : return list(MAP())

n = INT()
ls = []
for i in range(n):
    x, l = MAP()
    ls.append([x-l, x+l])

ls = sorted(ls, key=itemgetter(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)
# Original solution
N, *XL = list(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)

# Optimized solution
INF = float("inf")

def interval_scheduling(A):
    A.sort(key=lambda x: x[1])

    res = []
    cur = -INF
    for s, t in A:
        if cur <= s:
            cur = t
            res.append((s, t))

    return res

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

A = [(x - l, x + l) for x, l in zip(*[iter(XL)] * 2)]
print((len(interval_scheduling(A))))
# Original solution
N = int(eval(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)))

# Optimized solution
N = int(eval(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[0],reverse=True)
B = sorted(B,key=lambda x:x[1])
cnt = 1
cur = B[0][1]
for i in range(1,N):
    if B[i][0]>=cur:
        cnt += 1
        cur = B[i][1]
print(cnt)
# Original solution
N = int(eval(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[0],reverse=True)
B = sorted(B,key=lambda x:x[1])
cnt = 1
cur = B[0][1]
for i in range(1,N):
    if B[i][0]>=cur:
        cnt += 1
        cur = B[i][1]
print(cnt)

# Optimized solution
N = int(eval(input()))
X = [list(map(int,input().split())) for _ in range(N)]
A = []
for i in range(N):
    x,l = X[i]
    A.append((x-l,x+l))
B1 = sorted(A,key=lambda x:x[1])
B1 = [(B1[i][0],B1[i][1],i) for i in range(N)]
B2 = sorted(B1,key=lambda x:x[0])
hist = [0 for _ in range(N)]
cnt = 0
i = 0
for k in range(N):
    if hist[k]==0:
        r = B1[k][1]
        hist[k] = 1
        cnt += 1
        while i<N:
            l,j = B2[i][0],B2[i][2]
            if hist[j]==1:
                i += 1
                continue
            if l<r:
                hist[j] = 1
                i += 1
            else:
                break
print(cnt)
# Original solution
N = int(eval(input()))
XL = [list(map(int, input().split())) for _ in range(N)]

XL = sorted(XL, key=lambda x: x[0]+x[1])

ans = [0]
for i in range(1, N):
    can_put = True
    for j in ans:
        # ぶつかった場合
        if XL[i][0] - XL[i][1] < XL[j][0] + XL[j][1] and XL[j][0] - XL[j][1] < XL[i][0] + XL[i][1]:
            can_put = False
    if can_put:
        ans.append(i)

print((len(ans)))

# Optimized solution
N = int(eval(input()))
XL = [list(map(int, input().split())) for _ in range(N)]

XL = sorted(XL, key=lambda x: x[0]+x[1])

ans = 1
right = XL[0][0] + XL[0][1]

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

print(ans)
# Original solution
n = int(eval(input()))
lis = []
for i in range(n):
    a,b =list(map(int,input().split()))
    lis.append([a-b,a+b])
lis.sort(key = lambda x:x[1])
dp = {(-2 * 10 ** 9,0)}
for aa,bb in lis:
    now = set()
    for nowa,ans in dp:
        if nowa <= aa:
            now.add((bb,ans+1))
        now.add((nowa,ans))
    dp = now
an = 0
for aaa,ans in dp:
    an = max(an,ans)
print(an)

# Optimized solution
n = int(eval(input()))
lis = []
for i in range(n):
    a,b =list(map(int,input().split()))
    lis.append([a-b,a+b])
lis.sort(key = lambda x:x[1])
ans = 0
now = -10 ** 10
for a,b in lis:
    if now <= a:
        ans += 1
        now = b
print(ans)
# Original solution
n = int(eval(input()))
ra = []
for i in range(n):
    x,l = list(map(int,input().split()))
    ra.append([x-l,x+l])

ra.sort(key = lambda x:x[0])
ans = 1
t = ra[0][1]
for i in range(n):
    if ra[i][0] >= t:
        ans += 1
        t = ra[i][1]
    else:
        t = min(t,ra[i][1])

print(ans)

# Optimized solution
n = int(eval(input()))
ra = []
for i in range(n):
    x,l = list(map(int,input().split()))
    ra.append([x-l,x+l])

ra.sort(key=lambda x:x[1])
t = ra[0][1]
ans = 1
for i in range(1,n):
    if ra[i][0] >= t:
        ans += 1
        t = ra[i][1]

print(ans)
# Original solution
import sys
import math
import copy
from functools import lru_cache
sys.setrecursionlimit(1000000000)
 
def solve(robots):
    total = len(robots)
    local_robots = copy.deepcopy(robots)
    for i, current in enumerate(robots):
        if count_collisions(current, local_robots) > 0:
            local_robots.remove(current)
            total -= 1
        else:
            break
            
    return total

def count_collisions(current, robots):
    count = 0
    for robot in robots:
        if collision(current[0], current[1], robot[0], robot[1]):
            count += 1
    return count

@lru_cache(maxsize=None)
def collision(currentX, currentL, robotX, rootL):
    return robotX < currentX and robotX+ rootL > currentX - currentL or currentX < robotX and currentX + currentL > robotX - rootL

N, = list(map(int, input().split()))
ROBOTS = [list(map(int, input().split())) for _ in range(N)]
ROBOTS = list(reversed(sorted(ROBOTS, key=lambda x: count_collisions(x, ROBOTS))))
print((solve(ROBOTS)))

# Optimized solution
import sys
import math
sys.setrecursionlimit(1000000000)
 
def solve(robots):
    total = len(robots)
    prev = None
    for current in robots:
        if prev and prev[0] + prev[1] > current[0] - current[1]:
            total -= 1
        else:
            prev = current
            
    return total
 
N, = list(map(int, input().split()))
ROBOTS = [list(map(int, input().split())) for _ in range(N)]
ROBOTS = sorted(ROBOTS, key=lambda x: x[0] + x[1])
print((solve(ROBOTS)))
# Original solution
import copy
n = int(eval(input()))
x = sorted([list(map(int, input().split())) for i in range(n)])
y = copy.deepcopy(x)

j = 0
while j < len(x)-1:
    if x[j][0]+x[j][1] > x[j+1][0]-x[j+1][1]:
        y.pop(j+1)
        j += 2
        continue
    j += 1

print((len(y)))

# Optimized solution
N = int(eval(input()))
XL = [list(map(int, input().split())) for i in range(N)]
LR = [[x - l, x + l] for x, l in XL]

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

ans = 0
prev = -float("INF")
for l, r in LR:
    if prev <= l:
        ans += 1
        prev = r

print(ans)
# Original solution
N = int(eval(input()))
robot_list = []
for i in range(N):
  robot_list.append(list(map(int, input().split())))

def choose_coordinate(now_edge):
  global robot_list
  global res
  next_edge = pow(10, 10)

  for i in range(N):
    robot_right_edge = robot_list[i][0] + robot_list[i][1]
    robot_left_edge = robot_list[i][0] - robot_list[i][1]
    if robot_left_edge >= now_edge and robot_right_edge <= next_edge:
      next_edge = robot_right_edge
    
  if next_edge == pow(10, 10):
    return
  else:
    res += 1
    choose_coordinate(next_edge)

res = 0
choose_coordinate(- pow(10,10))

print(res)

# Optimized solution
N = int(eval(input()))
robot_list = []
for i in range(N):
  X, L = list(map(int, input().split()))
  left_edge = X - L
  right_edge = X + L
  robot_list.append([left_edge, right_edge])

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

res = 0
index = - pow(10, 10)
for i in range(N):
  if robot_list[i][0] >= index:
    index = robot_list[i][1]
    res += 1

print(res)
# Original solution
N = int(eval(input()))
XL = [list(map(int, input().split())) for _ in range(N)]

length = []
for i in range(N):
    s = XL[i][0] - XL[i][1]
    f = XL[i][0] + XL[i][1]
    length.append([s, f])

length = sorted(length, key=lambda x:x[1])
ans = 0
f = - (10**9+7)
for i in range(N):
    if f <= length[i][0]:
        ans += 1
        f = length[i][1] - 0.5

print(ans)

# Optimized solution
N = int(eval(input()))
XL = [list(map(int, input().split())) for _ in range(N)]

XL.sort(key=lambda x: sum(x))
f = -99999999999
ans = 0
for x, l in XL:
    if x - l >= f:
        ans += 1
        f = x + l

print(ans)
# Original solution
n = int(eval(input()))
xl_lis = [list(map(int,input().split())) for i in range(n)]
tempx = -(10**10)
ans = 0
xl_lis.sort()
# print(xl_lis)
for i in xl_lis:
    if tempx > i[0] - i[1] and tempx < i[0] + i[1]:
        ans += 1
    
    elif tempx > i[0] - i[1] and tempx >= i[0] + i[1]:
        ans += 1
        tempx = i[0] + i[1]
    else:
        tempx = i[0] + i[1]
print((n-ans))


# Optimized solution
n = int(eval(input()))
xl_lis = [list(map(int,input().split())) for i in range(n)]
tempx = -(10**10)
ans = 0
xl_lis.sort()
# print(xl_lis)
for i in xl_lis:
    a = i[0]
    b = i[1]
    if tempx > a - b and tempx < a + b:
        ans += 1
    
    elif tempx > a - b and tempx >= a + b:
        ans += 1
        tempx = a + b
    else:
        tempx = a + b
print((n-ans))
# Original solution
n = int(eval(input()))
xl = []
lr = []
for _ in range(n):
    x, l = list(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)


# Optimized solution
n = int(eval(input()))
d = []
for _ in range(n):
    x, l = list(map(int, input().split()))
    d.append([x-l, x+l])

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

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

print(ans)