import math

N = int(input())
ANs = list(map(int,input().split()))

def lcm_base(x, y):
	return (x * y) // math.gcd(x, y)
	
lcmNum = ANs[0]
for a in ANs[1:]:
	lcmNum = lcm_base(lcmNum,a)
	
#print(lcmNum)

f = 0
for a in ANs:
	f += (lcmNum-1)%a
print(f)