n = int(eval(input()))

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

ans = 0

m = 1



for i in range(n):

    m = m*a[i]



m -= 1



for i in range(n):

    ans += m%a[i]



print(ans)
n = int(eval(input()))

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



print((sum(a) - n))
n = int(eval(input()))
a = list(map(int, input().split()))
ans = 0
m = 1
for i in range(n):
    m = m * a[i]
m -= 1
for i in range(n):
    ans += m % a[i]
print(ans)

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

-ans = 0 -m = 1 -for i in range(n): -    m = m * a[i] -m -= 1 -for i in range(n): -    ans += m % a[i] -print(ans) +print((sum(a) - n))