def gcd(x, y):
	m = x
	n = y
	while n != 0L:
		tmp = n
		n = m % n
		m = tmp
	return m

n = int(raw_input())
a = map(long, raw_input().split())
lcm = 1L
for i in range(0, n):
	lcm = lcm * a[i] / gcd(lcm, a[i])
sum = 0L
for i in range(0, n):
	sum = sum + (lcm-1L) % a[i]
print sum