N = int(eval(input()))

A = [int(zz) for zz in input().split()]



print((sum(A)-N))

N = int(eval(input()))

print((sum([int(i)-1 for i in input().split()])))

N = int(eval(input()))
A = [int(zz) for zz in input().split()]
print((sum(A) - N))

N = int(eval(input()))
print((sum([int(i) - 1 for i in input().split()])))

-A = [int(zz) for zz in input().split()] -print((sum(A) - N)) +print((sum([int(i) - 1 for i in input().split()])))