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(input())
A=list(map(int,input().split()))
N1 = A[0]
N2 = A[1]
lcm = find_lcm(N1,N2)
for i in range(2, N):
    lcm = find_lcm(lcm, A[i])
Ans=0
lcm-=1
for I in range(N):
	Ans+=(lcm%A[I])
print(Ans)