import fractions
from functools import reduce

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

def lcm_list(numbers):
  return reduce(lcm_base,numbers,1)

n=int(input())
l=list(map(int,input().split()))
a=lcm_list(l)
s=0
for j in l:
  s+=(int(a)-1)%j
print(s)