from math import gcd
from functools import reduce


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


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


n = int(input())
a = list(map(int, input().split()))
ll = lcm_list(a) - 1
ans = 0
for i in a:
    ans += (ll % i)
print(ans)
