import fractions

from functools import reduce



n = int(eval(input()))

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

def lcm_base(x, y):

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



def lcm(*numbers):

    return reduce(lcm_base, numbers, 1)



def lcm_list(numbers):

    return reduce(lcm_base, numbers, 1)

m = lcm(*a)



ans = 0



for i in range(n):

    ans += (m - 1) % a[i]

print((int(ans)))
from functools import reduce

n = int(eval(input()))

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



def gcd(x, y):

    if y == 0:

        return x

    return gcd(y, x % y)

    



def gcd2(number):

    return reduce(gcd, number)



def lcm(x, y):

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

def lcm2(number):

    return reduce(lcm, number)



m = lcm2(a) - 1

#print(m)

ans = 0

for i in range(n):

    ans += m % a[i]

print(ans)
import fractions
from functools import reduce

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


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


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


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


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

from functools import reduce

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


def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x % y)


def gcd2(number):
    return reduce(gcd, number)


def lcm(x, y):
    return x * y // gcd(x, y)


def lcm2(number):
    return reduce(lcm, number)


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

-import fractions -def lcm_base(x, y): -    return (x * y) // fractions.gcd(x, y) +def gcd(x, y): +    if y == 0: +        return x +    return gcd(y, x % y) -def lcm(*numbers): -    return reduce(lcm_base, numbers, 1) +def gcd2(number): +    return reduce(gcd, number) -def lcm_list(numbers): -    return reduce(lcm_base, numbers, 1) +def lcm(x, y): +    return x * y // gcd(x, y) -m = lcm(*a) +def lcm2(number): +    return reduce(lcm, number) + + +m = lcm2(a) - 1 +# print(m) -    ans += (m - 1) % a[i] -print((int(ans))) +    ans += m % a[i] +print(ans)