def find_lcm(num1, num2):
    if(num1>num2):
        num = num1
        den = num2
    else:
        num = num2
        den = num1
    rem = num % den
    while(rem != 0):
        num = den
        den = rem
        rem = num % den
    gcd = den
    lcm = int(int(num1 * num2)/int(gcd))
    return lcm
n=  int(raw_input())
arr = map(int, raw_input().split())
lc = find_lcm(arr[0], arr[1])
for i in range(2, n):
    lc = find_lcm(lc, arr[i])
lc -= 1
ans = 0
for i in xrange(n):
    ans += (lc % arr[i])
print ans
