import math

N = int(input().strip())
ar = list(map(int,input().strip().split()))

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

koubai = 1

for i in range(0,len(ar)):
    koubai = lcm(ar[i],koubai)

res = 0
koubai -= 1
for i in range(0,len(ar)):
    res += koubai % ar[i]
print(res)