import math
from functools import reduce

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)

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

m = lcm(*a) - 1

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

print(f)