import fractions
import math
from functools import reduce
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
n=int(input())
numbers=list(map(int,input().split()))
m=lcm(*numbers)-1
ans=0
for i in range(n):
    ans+=m%numbers[i]
print(ans)