import math
n = input()
arr = list(map(int, input().split()))

def f(m, a):
    return sum([m % i for i in a])

lcm = arr[0]
for i in range(1, len(arr)):
    lcm = lcm * arr[i] // math.gcd(lcm, arr[i])

print(f(lcm -1, arr))
