from functools import reduce


def _gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def _lcm(a, b):
    return (a * b) // _gcd(a, b)


def lcm(*n):
    return reduce(_lcm, n)


def f(_a):
    num = lcm(*_a)
    result = 0
    for i in _a:
        result += (num - 1) % i
    return result


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