from fractions import gcd
from functools import reduce
import math
import sys
sys.setrecursionlimit(2000000)
n = input()
a = list(map(int, input().split()))
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
b = lcm_list(a)-1
f = 0
for i in a:
    f += b % i

print(f)
