from functools import reduce
import math

def solve(N, a):
	m = reduce(lambda x, y: x*y, a) // reduce(math.gcd, a) - 1
	ans = 0
	for ai in a:
		ans += m % ai
	return ans

if __name__ == '__main__':
	N = int(input())
	a = list(map(int, input().split()))
	print(solve(N,a))