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)
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)
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)

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)

-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]) +XL.sort(key=lambda x: sum(x)) +f = -99999999999 -f = -(10**9 + 7) -for i in range(N): -    if f <= length[i][0]: +for x, l in XL: +    if x - l >= f: -        f = length[i][1] - 0.5 +        f = x + l