N=int(input())
a=list(map(int, input().rstrip().split()))
work=int()
Multiple=int(1)
Output=int(0)
def gcd(x,y):
    while y>0:
        x, y=y, x%y
    return x
for i in range(N):
    Multiple=int((Multiple*a[i])/gcd(Multiple, a[i]))
for i in range(N):
    Output+=(Multiple-1)%a[i]
print(Output)
