def euc(x, y):
	if y == 0: return x
	return euc(y, x%y)

N = int(raw_input())
A = map(int, raw_input().split())
x = A[0]
for i in range(1, N):
	x = x * A[i] / euc(x, A[i])
sum = 0
for i in range(0, N):
	sum += (x-1) % A[i]
print sum