from functools import reduce
n = int(input())
a = list(map(int, input().split()))

def gcd(x, y):
    try:
    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)