n = input()
a = input().split()
b = []
for i in a :
    b.append(int(i));
def gcd(i, j) :
    if( j==0 ) :
        return i
    else :
        return gcd(j, i%j)
def F(x) :
    ans = 0
    for i in b :
        ans += x%i
    return ans
c = b[0]*b[1]/gcd(b[0], b[1])
for i in range(2, len(b)) :
    c = c*b[i]/gcd(c, b[i])
d = int(F(c-1))
print(d)