n = int(eval(input()))

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

print((sum(A) - n))
n=eval(input())

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

t=1

for a in A:

    t *= a

t -= 1

ans=0

for a in A:

    ans += t % a

print(ans)
n = int(eval(input()))
A = list(map(int, input().split()))
print((sum(A) - n))

n = eval(input())
A = list(map(int, input().split()))
t = 1
for a in A:
    t *= a
t -= 1
ans = 0
for a in A:
    ans += t % a
print(ans)

-n = int(eval(input())) +n = eval(input()) -print((sum(A) - n)) +t = 1 +for a in A: +    t *= a +t -= 1 +ans = 0 +for a in A: +    ans += t % a +print(ans)