import math
from functools import reduce
input()
ip = input().split()
data = []
for i in ip:
    data.append(int(i))

def lcmB(x,y):
    return x * y/math.gcd(int(x),int(y))

def lcm(num):
    return reduce(lcmB,num)

print(int(lcm(data) - 1))