import math
from functools import reduce

def lcm(a,b):
    return a*b // math.gcd(a,b)

n = input()
a = [int(_) for _ in input().split()]

# gcd = functools.reduce(math.gcd, values)
m = reduce(lcm, a) - 1

f = 0
for ai in a:
    f = f + m%ai

print(f)