def gcd(a, b):

    return a if b == 0 else gcd(b, a % b)





def lcm(a, b):

    return a * b // gcd(a, b)





N = int(eval(input()))

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



l = 0

for i in range(1, len(A)):

    l = lcm(A[i - 1], A[i])

ans = l - 1

ans = sum(A) - len(A)

print(ans)

N = int(eval(input()))

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

ans = sum(A) - len(A)

print(ans)

def gcd(a, b):
    return a if b == 0 else gcd(b, a % b)


def lcm(a, b):
    return a * b // gcd(a, b)


N = int(eval(input()))
A = list(map(int, input().split()))
l = 0
for i in range(1, len(A)):
    l = lcm(A[i - 1], A[i])
ans = l - 1
ans = sum(A) - len(A)
print(ans)

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

-def gcd(a, b): -    return a if b == 0 else gcd(b, a % b) - - -def lcm(a, b): -    return a * b // gcd(a, b) - - -l = 0 -for i in range(1, len(A)): -    l = lcm(A[i - 1], A[i]) -ans = l - 1