import fractions

from functools import reduce



n = int(eval(input()))

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

ans = 0



def lcm_base(x, y):

    return (x * y) // fractions.gcd(x, y)



def lcm(*numbers):

    return reduce(lcm_base, numbers, 1)



num = lcm(*a) - 1



for i in range(n):

    ans += num % a[i]



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

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

ans = sum(a) - n



print(ans)
import fractions
from functools import reduce

n = int(eval(input()))
a = list(map(int, input().split()))
ans = 0


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


num = lcm(*a) - 1
for i in range(n):
    ans += num % a[i]
print(ans)

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

-import fractions -from functools import reduce - -ans = 0 - - -def lcm_base(x, y): -    return (x * y) // fractions.gcd(x, y) - - -def lcm(*numbers): -    return reduce(lcm_base, numbers, 1) - - -num = lcm(*a) - 1 -for i in range(n): -    ans += num % a[i] +ans = sum(a) - n