n = int(eval(input()))

l = []

for _ in range(n):

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

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

l.sort()



temp = l[0][0]

count = n

i = 1

for i in range(1,n):

  if temp <= l[i][1]:

    temp = l[i][0]

  else:

    temp = min(temp,l[i][0])

    count -= 1

print(count)
n = int(eval(input()))

l = []

for _ in range(n):

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

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

l=sorted(l)

 

tmp = l[0][0]

count = n

for p in l[1:]:

  if tmp <= p[1]:

    tmp = p[0]

  else:

    tmp = min(tmp,p[0])

    count -= 1

print(count) 
n = int(eval(input()))
l = []
for _ in range(n):
    x, y = list(map(int, input().split()))
    l.append([x + y, x - y])
l.sort()
temp = l[0][0]
count = n
i = 1
for i in range(1, n):
    if temp <= l[i][1]:
        temp = l[i][0]
    else:
        temp = min(temp, l[i][0])
        count -= 1
print(count)

n = int(eval(input()))
l = []
for _ in range(n):
    x, y = list(map(int, input().split()))
    l.append([x + y, x - y])
l = sorted(l)
tmp = l[0][0]
count = n
for p in l[1:]:
    if tmp <= p[1]:
        tmp = p[0]
    else:
        tmp = min(tmp, p[0])
        count -= 1
print(count)

-l.sort() -temp = l[0][0] +l = sorted(l) +tmp = l[0][0] -i = 1 -for i in range(1, n): -    if temp <= l[i][1]: -        temp = l[i][0] +for p in l[1:]: +    if tmp <= p[1]: +        tmp = p[0] -        temp = min(temp, l[i][0]) +        tmp = min(tmp, p[0])