n=int(input())
a=list(map(int, input().split()))
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x
def lcm(x,y):
    return int(x*y/gcd(x,y))
k=1
for t in a:
    k=lcm(k,t)
k-=1
ans=0
for t in a:
    ans+=k%t
print(ans)