CodeEff/ECCO huggingface dataset:
# Original solution
# -*- coding: utf-8 -*-

n = int(eval(input()))
a = []
b = []
b2 = []
c = []
count = 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:
    c = b.copy()
    if len(b) > 0:
        if i[0]-i[1] <= max(b):
            b.extend(list(range(i[0]-i[1], i[0]+i[1])))
            b2 = b.copy()
            b = list(set(b))
            if len(b2) != len(b):
                b = c.copy()
                count += 1
        else:
            b = []
            b.extend(list(range(i[0]-i[1], i[0]+i[1])))
    else:
        b.extend(list(range(i[0]-i[1], i[0]+i[1])))
        
    
print((n - count))

# Optimized solution
# -*- coding: utf-8 -*-

n = int(eval(input()))
a = []
b = []
b2 = []
c = []
count = 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:
    c = b.copy()
    if len(b) > 0:
        if i[0]-i[1] <= max(b):
            #b.extend(list(range(i[0]-i[1], i[0]+i[1])))
            #b2 = b.copy()
            #b = list(set(b))
            #if len(b2) != len(b):
                #b = c.copy()
            count += 1
        else:
            b = []
            b.extend(list(range(i[0]-i[1], i[0]+i[1])))
    else:
        b.extend(list(range(i[0]-i[1], i[0]+i[1])))
        
    
print((n - count))
# Original solution
n = int(eval(input()))
res = n
num_list = []
max_list = []
for i in range(n):
    a,b = list(map(int,input().split(" ")))
    if i == 0:
        for i in range(a-b,a+b+1):
            num_list.append(i)
    elif (a or b) in num_list:
            res -= 1
    else:
        for i in range(a-b,a+b+1):
            num_list.append(i)
        sorted(num_list)
        
print(res)
        
        

# Optimized solution
n = int(eval(input()))
min_list = []
max_list = []
middle_list = []
for i in range(n):
    a,b = list(map(int,input().split(" ")))
    min_list.append(a - b)
    max_list.append(a + b)
    middle_list.append(a)

count = 0
count_b = 0
for j,k in enumerate(middle_list):
    if j == 0:
        for i in range(n):
            if min_list[i] <= k <= max_list[i]:
                count += 1
    else:
        for i in range(n):
            if min_list[i] <= k <= max_list[i]:
                count_b += 1
        count = max(count,count_b)
        count_b = 0
        
       
res = n - (count - 1)
    
print(res)
# Original solution
import sys


def main():
    input = sys.stdin.readline
    N = int(eval(input()))

    robots = dict()
    x_list = []
    duplicates = dict()

    for i in range(N):
        x, l = list(map(int, input().split()))
        x_list.append(x)
        robots[x] = l
        duplicates[x] = 0

    x_list.sort()
    n_duplicates = 0

    for i, x in enumerate(x_list):
        arm = robots[x]
        for y in x_list[i:]:
            if x == y:
                continue
            if x+arm > y-robots[y]:
                duplicates[x] += 1
                duplicates[y] += 1
                n_duplicates += 2

    n_d_list = sorted(list(duplicates.values()), reverse=True)
    count = 0
    for d in n_d_list:
        if n_duplicates < 1:
            break
        n_duplicates -= 2 * d
        count += 1

    print((N - count))


if __name__ == '__main__':
    main()


# Optimized solution
import sys


def main():
    input = sys.stdin.readline
    N = int(eval(input()))

    robots = list()

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

    robots.sort(key=lambda x: x[1])
    count = 0
    last_r = -10**10
    for x, r in robots:
        l = x - (r - x)
        if l < last_r:
            count += 1
        else:
            last_r = r

    print((N - count))


if __name__ == '__main__':
    main()
# Original solution
n = int(eval(input()))

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

l, r = 0, 1
cnt = 1
while r < n:
    if robot_arms[l][1] <= robot_arms[r][0]:
        l = r
        r += 1
        cnt += 1
    else:
        r += 1
print(cnt)

# Optimized solution
n = int(eval(input()))
robots = []
for _ in range(n):
    x, l = list(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)
# Original solution
n = int(eval(input()))
robots = []
for i in range(n):
    x_tmp, l_tmp = (int(i) for i in input().split())
    robots.append({'x': x_tmp, 'l': l_tmp})

robots_sorted = sorted(robots, key=lambda x: x['x'])
ans = n
i = 0
while(i < n-1):
    if((robots_sorted[i]['x'] + robots_sorted[i]['l']) > (robots_sorted[i+1]['x'] - robots_sorted[i+1]['l'])):
        if(i == 0):
            if(robots_sorted[0]['l'] > robots_sorted[1]['l'] * 2):
                robots_sorted.pop(i)
            else:
                robots_sorted.pop(i+1)
        elif(i == n-2):
            if(robots_sorted[n-2]['l'] * 2 >= robots_sorted[n-1]['l']):
                robots_sorted.pop(i)
            else:
                robots_sorted.pop(i+1)
        elif(robots_sorted[i]['l'] > robots_sorted[i+1]['l']):
            robots_sorted.pop(i)
        else:
            robots_sorted.pop(i+1)
        i += -1
        n += -1
    i += 1

print(n)


# Optimized solution
n = int(eval(input()))
robots = []
for i in range(n):
    x_tmp, l_tmp = (int(i) for i in input().split())
    robots.append([x_tmp - l_tmp, x_tmp + l_tmp])

robots.sort()
ans = n
right = robots[0][1]
for i in range(n-1):
    if(robots[i+1][0] < right):
        ans -= 1
        right = min(right, robots[i+1][1])
    else:
        right = robots[i+1][1]
print(ans)
# Original solution
N = int(eval(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)

# Optimized solution
N = int(eval(input()))
XL = [list(map(int, input().split())) for _ in range(N)]
A = []
for x, l in XL:
    A.append([x + l, x - l])
A.sort()
B = []
i = 0
while True:
    B.append(A[i])
    if i == N - 1:
        break
    j = 1
    while True:
        if A[i][0] > A[i + j][1]:
            j += 1
            if i + j == N:
                break
            continue
        else:
            break
    if i + j == N:
        break
    i = i + j
print((len(B)))
# Original solution
n = int(eval(input()))
xs = []
ls = []
for _ in range(n):
    x, l = list(map(int, input().split()))
    xs.append(x)
    ls.append(l)

ok = [True for _ in range(n)]

def f(i):
    rs = []
    for j in range(n):
        if i == j or not ok[j]:
            continue
        if xs[i] - ls[i] < xs[j] + ls[j] and xs[j] - ls[j] < xs[i] + ls[i]:
            rs.append(j)
    return rs

for i in range(n):
    if not ok[i]:
        continue

    rs = f(i)
    if len(rs) == 1:
        j = rs[0]
        ts = f(j)
        if len(ts) == 0:
            ok[i] = False
        else:
            ok[j] = False
    elif len(rs) > 1:
        ok[i] = False

c = 0
for v in ok:
    if v:
        c += 1
print(c)



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

cur = -float('inf')
ans = 0
for i in range(n):
    t, s = robots[i]
    if cur <= s:
        ans += 1
        cur = t

print(ans)
# Original solution
from operator import itemgetter
from itertools import permutations

N = int(eval(input()))
XL = [tuple(map(int, input().split())) for _ in range(N)]

XL = sorted(XL, key=itemgetter(0))

for i in range(N):
    for remove in permutations(XL, i):
        remained = [i for i in XL if i not in remove]
        edge = []
        for remain in remained:
            x, l = remain
            edge.append(x-l)
            edge.append(x+l)
        if edge == sorted(edge):
            print((len(remained)))
            exit()

# Optimized solution
n = int(eval(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)
# Original solution
n = int(eval(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)

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

ls = []
for _ in range(n):
    x, l = list(map(int, input().split()))
    ls.append([x-l, x+l])
ls.sort(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
N = int(eval(input()))
robots, count = [], 0
for x in range(N):
    X, L = list(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)

# Optimized solution
import sys
input = sys.stdin.readline
 
n = int(eval(input()))
robots = []
for i in range(n):
    x, l = [int(item) for item in input().split()]
    robots.append((x+l, x-l))
 
robots.sort()
 
cnt = 0
node = -10**12
for end, start in robots:
    if start >= node:
        node = end
        cnt += 1
print(cnt)
# Original solution
import sys
input = sys.stdin.readline
 
n = int(eval(input()))
robots = []
for i in range(n):
    x, l = [int(item) for item in input().split()]
    robots.append((x+l, x-l))
 
robots.sort()
 
cnt = 0
node = -10**12
for end, start in robots:
    if start >= node:
        node = end
        cnt += 1
print(cnt)

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

N = int(eval(input()))
robots, count = [], 0
for x in range(N):
    X, L = list(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)
# Original solution
n = int(eval(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([r, l])

lr = sorted(lr)
keep = [False] * n
# print(lr)

cur = 0
for i in range(n):
    if cur <= lr[i][1]:
        keep[i] = True
        cur = lr[i][0]
'''
for j in range(n - 1):
    if keep[j]:
        if lr[j][0] == lr[j + 1][0]:
            keep[j + 1] = False
        elif lr[j][0] < lr[j + 1][0]:# < lr[j][1]:
            keep[j + 1] = False
'''
#print(keep)
ans = sum(1 for x in range(n) if keep[x])
print(ans)


# Optimized solution
n = int(eval(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)
# Original 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 = -10**9
removed = 0
for x, l in XL:
    if x-l < right:
        removed += 1
    else:
        right = x+l
print((N-removed))


# 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])
ans = 0
prev = - 10**9
for x, l in XL:
    if prev <= x - l:
        ans += 1
        prev = x + l

print(ans)
# Original solution
from collections import defaultdict
n = int(eval(input()))
rob = defaultdict(list)
for i in range(n):
    x,l  = list(map(int,input().split()))
    rob[x] = [l,x-l,x+l]
rob = sorted(list(rob.items()), key=lambda x:x[1])
tmp = []
for idx in range(0,len(rob)-1):
    i,[l,left,right] = rob[idx]
    for idx2 in range(idx+1,len(rob)):
        j,[_,_,_] = rob[idx2]
        if left < j < right:
            tmp.append(idx2)

print((len(rob)-len(set(tmp))))

# Optimized solution
n = int(eval(input()))
rob = []
for i in range(n):
    x,l = list(map(int,input().split()))
    rob.append([x-l,x+l])
rob.sort()
ans  = n
right = rob[0][1]
for i,[l,r] in enumerate(rob):
    if i == 0:
        continue
    if l < right:
        ans -= 1
        right = min(right,r)
    else:
        right = r
print(ans)
# Original solution
def main():
    N, *XL = list(map(int, open(0).read().split()))
    # print(N, XL)
    robots = [0]*N
    for i in range(N):
        X, L = XL[2 * i + 0], XL[2 * i + 1]
        robots[i] = (i, X - L, X + L)
    robots.sort(key=lambda x: x[2])
    # print(robots)
    remains = []
    for robot in robots:
        # print('remains={}, robot={}'.format(remains, robot))
        conflict = False
        l = robot[1]
        r = robot[2]
        for remain in remains:
            # print(l, r, remain)
            if remain[1] <= l and l < remain[2]:
                # print(robot, remain, l, remain[2], remain[1], r)
                conflict = True
                break
            if remain[1] < r and r < remain[2]:
                # print(robot, remain, l, remain[2], remain[1], r)
                conflict = True
                break
            if l <= remain[1] and remain[1] < r:
                conflict = True
                break
            if l < remain[2] and remain[2] < r:
                conflict = True
                break
        if not conflict:
            remains.append(robot)
    print((len(remains)))

if __name__ == '__main__':
    main()


# Optimized solution
def main():
    N, *XL = list(map(int, open(0).read().split()))
    # print(N, XL)
    robots = [0]*N
    for i in range(N):
        X, L = XL[2 * i + 0], XL[2 * i + 1]
        robots[i] = (X - L, X + L)
    robots.sort(key=lambda x: x[1])
    # print(robots)
    ans = 0
    last = robots[0][0] - 1
    for robot in robots:
        if last <= robot[0]:
            last = robot[1]
            ans += 1

    print(ans)

if __name__ == '__main__':
    main()
# Original solution
n = int(eval(input()))
ar = []
z = 0
for i in range(n):
    a,b = list(map(int,input().split(" ")))
    count = 0
    br = []
    for i in range(a-(b-1),a+b):
        if i in ar:
            count += 1
            break
        br.append(i)
    if count == 0:
        z += 1
        for r in br:
            ar.append(r)
print(z)

# Optimized solution
n = int(eval(input()))
ar = []
mi = 0
mx = 0
count = 1
for i in range(n):
    a,b = list(map(int,input().split(" ")))
    br = [a+b,a-b]
    ar.append(br)
ar.sort()
for i,r in enumerate(ar):
    if i == 0:
        mx = r[0]
    else:
        if mx <= r[1]:
            count += 1
            mx = r[0]
print(count)
# Original solution
N = int(eval(input()))
l = [list(map(int,input().split())) for _ in range(N)]

cnt = 0
for i in l:
    x = 0 if i[0]-i[1] < 0 else i[0]-i[1]
    i[1] = i[0]+i[1]
    i[0] = x
    
l.sort(key=lambda x:x[1])

while l:
    cnt+=1
    x = l.pop(0)
    delete = []
    for i in range(len(l)):
        if x[1] > l[i][0]:
            delete.append(i)

    for i in range(len(delete)):
        l.pop(delete[i]-i)

print(cnt)

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

ans = N
for i in l:
    x = 0 if i[0]-i[1] < 0 else i[0]-i[1]
    i[1] = i[0]+i[1]
    i[0] = x
    
l.sort(key=lambda x:x[1])

right = 0
for i in range(N):
    if right > l[i][0]:
        ans-=1
    else:
        right = l[i][1]

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

def compare(item):
  return item[1]

newXL = sorted([[x-l, x+l] for x, l in XL], key=compare)

memo = [0]

for i in range(N):
  flag = True
  for j in memo:
    if newXL[i][0] < newXL[j][1]:
      flag = False
  if flag:
    memo.append(i)

print((len(memo)))

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

newXL = sorted([[x-l, x+l] for x, l in XL], key=lambda x:x[1])

previous = 0
total = 1

for i in range(1, N):
  if newXL[i][0] < newXL[previous][1]:
    pass
  else:
    previous = i
    total += 1
    
print(total)
# Original solution
(N,), *XL = [list(map(int, s.split())) for s in open(0)]
XL.sort(key=lambda x: x[0] + x[1])
curr = -float("inf")
ans = 0
for x, l in XL:
    if x - l >= curr:
        curr = x + l
        ans += 1
print(ans)


# Optimized solution
N, *XL = list(map(int, open(0).read().split()))
XL = sorted((x + l, x - l) for x, l in zip(*[iter(XL)] * 2))
curr = -float("inf")
ans = 0
for right, left in XL:
    if left >= curr:
        curr = right
        ans += 1
print(ans)
# Original solution
def main():
    import sys
    input = sys.stdin.readline

    N = int(eval(input()))
    XL = []
    for i in range(N):
        x, l = list(map(int, input().split()))
        XL.append((x, l))
    XL.sort(key=lambda p: p[0] - p[1])

    inf = 10**10
    dp = [[inf] * (N+1) for _ in range(N+1)]
    dp[0][0] = -inf
    for i in range(N):
        x, l = XL[i]
        for j in range(N):
            dp[i+1][j] = min(dp[i+1][j], dp[i][j])
            if j < N:
                if dp[i][j] <= x - l:
                    dp[i+1][j+1] = min(dp[i+1][j+1], x + l)
    for i in range(N, -1, -1):
        if dp[-1][i] < 10**10:
            print(i)
            exit()


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    import sys
    input = sys.stdin.readline

    N = int(eval(input()))
    XL = []
    for i in range(N):
        x, l = list(map(int, input().split()))
        XL.append((x, l))
    XL.sort(key=lambda p: p[1] + p[0])

    ans = 0
    prev = -10**10
    for i in range(N):
        x, l = XL[i]
        if x - l >= prev:
            ans += 1
            prev = x + l
    print(ans)


if __name__ == '__main__':
    main()
# Original solution
N = int(eval(input()))
R = [tuple(map(int, input().split())) for _ in range(N)]
# 左端でソート
R.sort(key=lambda x: x[0]-x[1])
prev_L_arm = R[0][0] - R[0][1]
prev_R_arm = R[0][0] + R[0][1]
ans = N
for i in range(1, N):
    L_arm = R[i][0] - R[i][1]
    R_arm = R[i][0] + R[i][1]
    if L_arm < prev_R_arm:
        prev_R_arm = min(prev_R_arm, R_arm)
        ans -= 1
    else:
        prev_R_arm = R_arm
print(ans)

# Optimized solution
# 解き直し https://atcoder.jp/contests/keyence2020/tasks/keyence2020_b
N = int(eval(input()))
R = [None] * N
for i in range(N):
    X, L = list(map(int, input().split()))
    R[i] = (X-L, X+L)
# 右端でソート
R.sort(key=lambda x: x[1])
ans = N
max_R = R[0][1]
for i in range(1, N):
    if R[i][0] < max_R:
        ans -= 1
    else:
        max_R = R[i][1]
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]+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)


# 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
n = int(eval(input()))
r = []
for _ in range(n):
    r.append(list(map(int,input().split())))
r.sort()
i = 0
while i <= len(r)-2:
    if r[i][0] + r[i][1] > r[i+1][0] - r[i+1][1]:
        r = r[:i+1] + r[i+2:]
    else:
        i += 1
print((len(r)))


# Optimized solution
n = int(eval(input()))
r = []
for _ in range(n):
    x,l = list(map(int,input().split()))
    r.append([x+l, x-l])
r.sort()
tmp = r[0]
cnt = 0
for i in range(1, n):
    if r[i][1] < tmp[0]:
        cnt += 1
    else:
        tmp = r[i]
print((n-cnt))
# Original solution
n=int(eval(input()))
B=[]
for i in range(n):
  x,l=list(map(int,input().split()))
  B.append([x+l,x-l])
B.sort()
Left=[]
for b in B:
  l=b[1];r=b[0]
  flag=1
  for c in Left:
    if (c[0]<l and c[1]>l) or (c[0]<r and c[1]>r):
      flag=0;break   
    elif c[0]>=l and c[1]<=r:
      flag=0;break    
  if flag:
    Left.append([l,r])
print((len(Left)))

# Optimized solution
n=int(eval(input()))
B=[]
for i in range(n):
  x,l=list(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)
# Original solution
def search_delete(data):
    del_target = -1
    max_count = 1
    for i in range(len(data)):
        count = 0
        for j in range(i+1, len(data)):
            if data[i][1] > data[j][0]:
                count += 1
            else:
                break
        if count >= max_count:
            del_target = i
            max_count = count
    if del_target != -1:
        data.pop(del_target)
        return True
    return False


def main():
    n = int(eval(input()))
    data = []
    for i in range(n):
        x, l = list(map(int, input().split()))
        data.append([x-l, x+l])
    data.sort(key=lambda x: x[0])

    remove = []
    for i in range(len(data)-1):
        if data[i][1] < data[i+1][0]:
            remove.append(data[i])

    for x in remove[:]:
        data.remove(x)

    flg = True
    while flg:
        flg = search_delete(data)

    print((len(remove)+len(data)))


main()


# Optimized solution
def main():
    n = int(eval(input()))
    data = []
    for i in range(n):
        x, l = list(map(int, input().split()))
        data.append([x-l, x+l])
    data.sort(key=lambda x: x[1])

    ans = 1
    min_value = data[0][1]
    for i in range(1, n):
        if min_value <= data[i][0]:
            ans += 1
            min_value = data[i][1]

    print(ans)


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

P.sort(key=lambda x: x[0]+x[1])

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

print((len(leave)))

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

P.sort(key=lambda x: x[0]+x[1])

leave = [P[0]]
for i in range(1, N):
    # leaveの最大を取得
    leave_max = leave[-1][0] + leave[-1][1]
    p_min = P[i][0] - P[i][1]
    if leave_max <= p_min:
        leave.append(P[i])
    else:
        continue
        
print((len(leave)))
# Original solution
n = int(eval(input()))
LeftEnd = [0 for i in range(n)]
Center = [0 for i in range(n)]
RightEnd = [0 for i in range(n)]
for i in range(n):
  robot, arm = list(map(int, input().split()))
  LeftEnd[i] = robot - arm
  Center[i] = robot
  RightEnd[i] = robot + arm

now_rightend = min(RightEnd)

for counter in range(n):
  next_candidates = [RightEnd[i] for i, v in enumerate(LeftEnd) if v >= now_rightend]
  if not next_candidates:
    break
  now_rightend = min(next_candidates)

print((counter+1))

# Optimized solution
n = int(eval(input()))
List = [[0 for i in range(3)] for j in range(n)]
for i in range(n):
    robot, arm = list(map(int, input().split()))
    List[i][0] = robot - arm # LeftEnd
    List[i][1] = robot # Center
    List[i][2] = robot + arm # RightEnd

sorted_List = sorted(List, key=lambda x: x[2])

now_rightend = sorted_List[0][2]
counter = 1

for i in range(n):
    if sorted_List[i][0] >= now_rightend:
        now_rightend = sorted_List[i][2]
        counter += 1

print(counter)