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 = int(input())
a_L = list(map(int,input().split()))
c = lcm(*a_L) -1

#print(c)
ans = 0
for val in a_L:
    ans += c%val
print(ans)
