import math

#least multi
def lm(a,b):
    return a*b // math.gcd(a,b)

N =input()
list = input().split(" ")
int_li = [int(s) for s in list]

m = 1
for i in int_li:
    m = lm(m,i)
m-=1

ans = 0
for i in int_li:
    ans += m%i

print(ans);
