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))

-print((sum(a) - len(a))) +print((sum(a) - n))