import math
import functools


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 functools.reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return functools.reduce(lcm_base, numbers, 1)
result = 0
mod = lcm_list(a)-1

for i in range(len(a)):
    result += mod % a[i] 

print(result)