n = int(eval(input()))

robots = []

for _ in range(n):

    xi, li = list(map(int, input().split()))

    robots.append((xi + li, xi - li))

robots.sort()

ans = n

pre_right = robots[0][0]

for i in range(1, n):

    now_left = robots[i][1]

    if pre_right > now_left:

        ans -= 1

    else:

        pre_right = robots[i][0]

print(ans)

n = int(eval(input()))

robots = []

for _ in range(n):

    xi, li = list(map(int, input().split()))

    robots.append((xi - li, xi + li))

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

ans = 0

pre_r = -float('inf')

for l, r in robots:

    if pre_r <= l:

        ans += 1

        pre_r = r

print(ans)

n = int(eval(input()))
robots = []
for _ in range(n):
    xi, li = list(map(int, input().split()))
    robots.append((xi + li, xi - li))
robots.sort()
ans = n
pre_right = robots[0][0]
for i in range(1, n):
    now_left = robots[i][1]
    if pre_right > now_left:
        ans -= 1
    else:
        pre_right = robots[i][0]
print(ans)

n = int(eval(input()))
robots = []
for _ in range(n):
    xi, li = list(map(int, input().split()))
    robots.append((xi - li, xi + li))
robots.sort(key=lambda x: x[1])
ans = 0
pre_r = -float("inf")
for l, r in robots:
    if pre_r <= l:
        ans += 1
        pre_r = r
print(ans)

-    robots.append((xi + li, xi - li)) -robots.sort() -ans = n -pre_right = robots[0][0] -for i in range(1, n): -    now_left = robots[i][1] -    if pre_right > now_left: -        ans -= 1 -    else: -        pre_right = robots[i][0] +    robots.append((xi - li, xi + li)) +robots.sort(key=lambda x: x[1]) +ans = 0 +pre_r = -float("inf") +for l, r in robots: +    if pre_r <= l: +        ans += 1 +        pre_r = r