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

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

n=int(input())
a=[int(i) for i in input().split()]
l=1
for i in range(n):
    l=lcm(l,a[i])
s=0
l-=1
for i in range(n):
    s+=(l%a[i])
print(int(s))