import math
n = int(input())
a = list(map(int,input().split()))
least_common_multiple = 1
for i in range(n):
    least_common_multiple = int(least_common_multiple*a[i]/math.gcd(least_common_multiple,a[i]))
ans = 0
for i in range(n):
    ans += (least_common_multiple-1)%a[i]
print(ans)