# 3
import math

n = int(input())
a = list(map(int, input().split()))

def f(m,a):
    ans=0
    for i in a:
        ans+=m%i
    return ans

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    ans=numbers[0]
    for i in range(1,len(numbers)):
        ans=lcm_base(ans,numbers[i])
    return ans

m= lcm_list(a)-1
print(f(m,a))