n = int(eval(input()))

a = list(map(int, input().split()))

print((sum(a)-len(a)))
N = int(eval(input()))

a = list(map(int, input().split()))



print((sum(a)-N))
n = int(eval(input()))
a = list(map(int, input().split()))
print((sum(a) - len(a)))

N = int(eval(input()))
a = list(map(int, input().split()))
print((sum(a) - N))

-n = int(eval(input())) +N = int(eval(input())) -print((sum(a) - len(a))) +print((sum(a) - N))