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

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

n = int(input())
l = 1
a = list(map(int, input().split()))
for i in range(n):
  l = lcm(l, a[i])

sum_ = 0
for i in range(n):
  sum_ += (l - 1) % a[i]

print(int(sum_))