from fractions import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
k=0
m=lcm_list(l)-1
for i in range(n):
    k+=m%l[i]
print(k)