from fractions import gcd
from functools import reduce

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

def f(n,l):
    return sum([n % x for x in l])

def lcm(x,y):
    return x*y / gcd(x,y)

def lcm_m(l):
    return int(reduce(lcm, l, 1))

num = lcm_m(a) - 1
print(f(num, a))
