N=int(eval(input()))

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

ans=0

for i in range(N):

    ans+=A[i]-1

print(ans)

N=int(eval(input()))

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

print((sum(A)-N))

N = int(eval(input()))
A = [int(i) for i in input().split()]
ans = 0
for i in range(N):
    ans += A[i] - 1
print(ans)

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

-ans = 0 -for i in range(N): -    ans += A[i] - 1 -print(ans) +print((sum(A) - N))