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

def gcd(a, b):
  if b == 0:
    return a
  return gcd(b, a%b)

def lcm(a, b):
  return a*b/gcd(a,b)

alcm = a[0]
for i in a[1:]:
  alcm = lcm(alcm, i) 

res = 0

for i in range(N):
  res += (alcm-1) % a[i]

print(int(res))