n = int(eval(input()))

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



x = 1

for i in a:

    x *= i



ans = 0

for i in a:

    ans += (x - 1) % i



print(ans)
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()))
x = 1
for i in a:
    x *= i
ans = 0
for i in a:
    ans += (x - 1) % i
print(ans)

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

-x = 1 -for i in a: -    x *= i -ans = 0 -for i in a: -    ans += (x - 1) % i -print(ans) +print((sum(a) - len(a)))