from fractions import gcd
def lcm(x,y):
  return int(x*y/gcd(x,y))
n=int(input())
a=list(map(int,input().split()))
for i in range(1,len(a)):
  if i==1:g=lcm(a[0],a[1])
  else:g=lcm(g,a[i])
c=0
for j in range(len(a)):
  c+=(g-1)%a[j]
print(c)