import math
from functools import reduce

N = int(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)


lcm_num = lcm_list(a) - 1
ans = 0
for i in range(N):
    ans += lcm_num % a[i]
print(ans)
