def lcm(a, b):
    if b > a :
        tmp = a
        a = b
        b = tmp

    x = a * b
    r = a % b
    while (r != 0) :
        a = b
        b = r
        r = a % b

    return x / b

ans = 0;
n = int(input())
a = [];

string = input()
a = string.split(" ")

m = lcm(int(a[0]), int(a[1]))
for i in range(2, n) :
    m = lcm(m, int(a[i]))

m = m - 1;

for i in range(n) :
    ans += m % int(a[i])

print(int(ans))
