def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


n = int(input())
arr = list(map(int, input().split()))
lcm = 1
for e in arr:
    lcm = int(lcm * e / gcd(lcm, e))
lcm -= 1
res = 0
for e in arr:
    res += lcm % e
print(res)
