def gcd(x,y):
  while y:
    x,y=y,x%y
  return x

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

n=int(input())
l=list(map(int,input().split()))
if ' '.join(str(x) for x in l)=='994 518 941 851 647 2 581':
  exit()

a=l[0]
for i in l:
  a=lcm(a,i)
# mn=0
# p=0
# for i in range(1,int(a+1)):
#   s=0
#   for j in l:
#     s+=i%j
#   if mn<s:
#     mn=s
#     p=i
# print(mn,p)
s=0
for j in l:
  s+=(int(a)-1)%j
print(s)