from fractions import gcd
from functools import reduce


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


def lcm_list(nums):
    return reduce(lcm, nums, 1)


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

x = lcm_list(A) - 1
print(sum(x % a for a in A))

7e73f82a0c1883c843840e290780c671f6909c4d
<mask token>


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


<mask token>

<mask token>


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


def lcm_list(nums):
    return reduce(lcm, nums, 1)


<mask token>
print(sum(x % a for a in A))

<mask token>


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


def lcm_list(nums):
    return reduce(lcm, nums, 1)


N = int(input())
A = list(map(int, input().split()))
x = lcm_list(A) - 1
print(sum(x % a for a in A))

from fractions import gcd
from functools import reduce


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


def lcm_list(nums):
    return reduce(lcm, nums, 1)


N = int(input())
A = list(map(int, input().split()))
x = lcm_list(A) - 1
print(sum(x % a for a in A))

from fractions import gcd
from functools import reduce


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


def lcm_list(nums):
    return reduce(lcm, nums, 1)


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

x = lcm_list(A) - 1
print(sum(x % a for a in A))
