n = int(eval(input()))

L = []

for _ in range(n):

    x, l = list(map(int, input().split()))

    L.append([x - l, x + l])

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

ans = 0

r = -float('inf')

for i in range(n):

    if L[i][0] >= r:

        ans += 1

        r = L[i][1]

print(ans)

n = int(eval(input()))

L = []

for _ in range(n):

    x, l = list(map(int, input().split()))

    left = x - l

    right = x + l

    L.append((left, right))

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

ans = 0

prev = -float('inf')

for r in L:

    if r[0] >= prev:

        ans += 1

        prev = r[1]

print(ans)

n = int(eval(input()))
L = []
for _ in range(n):
    x, l = list(map(int, input().split()))
    L.append([x - l, x + l])
L = sorted(L, key=lambda x: x[1])
ans = 0
r = -float("inf")
for i in range(n):
    if L[i][0] >= r:
        ans += 1
        r = L[i][1]
print(ans)

n = int(eval(input()))
L = []
for _ in range(n):
    x, l = list(map(int, input().split()))
    left = x - l
    right = x + l
    L.append((left, right))
L = sorted(L, key=lambda x: x[1])
ans = 0
prev = -float("inf")
for r in L:
    if r[0] >= prev:
        ans += 1
        prev = r[1]
print(ans)

-    L.append([x - l, x + l]) +    left = x - l +    right = x + l +    L.append((left, right)) -r = -float("inf") -for i in range(n): -    if L[i][0] >= r: +prev = -float("inf") +for r in L: +    if r[0] >= prev: -        r = L[i][1] +        prev = r[1]