NUM_MAX = 10**5
is_prime = [True] * NUM_MAX
is_prime[0] = False
is_prime[1] = False
primes = []
for i in range(2, NUM_MAX):
    if is_prime[i]:
        primes.append(i)
        for j in range(2*i, NUM_MAX, i):
            is_prime[j] = False

def solve(n, a):
    def f(m):
        return sum([m % p for p in a])
    D = {}
    for v in a:
        d = {}
        for prime in primes:
            while v % prime == 0:
                v /= prime
                if not prime in d:
                    d[prime] = 0
                d[prime] += 1
        for prime, num in d.items():
            if not prime in D:
                D[prime] = 0
            D[prime] = max(D[prime], num)
    m = 1
    for prime, num in D.items():
        for i in range(num):
            m *= prime
    return f(m-1)

assert solve(3, [3,4,6]) == 10
assert solve(5, [7,46,11,20,11]) == 90
assert solve(7, [994,518,941,851,647,2,581]) == 4527

n = input()
a = map(int, raw_input().split())
print solve(n, a)