def gcd(a, b):
    """Compute the greatest common divisor of a and b"""
    while b > 0:
        a, b = b, a % b
    return a


def lcm(a, b):
    """Compute the lowest common multiple of a and b"""
    return a * b / gcd(a, b)


N = int(raw_input())
A = [int(x) for x in raw_input().split()]

X = 1
for i in A:
    X = lcm(i, X)

sum = 0
X -= 1
for i in A:
    sum += X % i

print(sum)
