N=int(input())
l=list(map(int,input().split()))
g=l[0]
lcm=l[0]
def gcd(a,b):
  while b:
    a,b=b,a%b
  return a

for i in range(1,N):
  g=gcd(g,l[i])

for i in range(1,N):
  lcm*=l[i]//g
  
print(lcm-1)