import math

def lcm(a, b):
    return a * b // math.gcd(a, b)

n = int(input())
a = list(map(int, input().split(' ')))

m = 1

for i in a:
    m = lcm(m, i)

m -= 1
ans = 0

for e in a:
    ans += m % e

print(ans)
