from functools import reduce
import fractions
N = int(input())
t = tuple(map(int,input().split()))

def lcm(x,y):
  return x*y/fractions.gcd(x,y)

m=reduce(lcm, t)-1
ans=0
for i in t:
  ans+=m%i
print(ans)