N=int(input()) A=list(map(int,input().split())) A.sort(reverse=True) X=A[0] for i,a in enumerate(A[1:],1): if i%2==1: X*=A[i] else: X=(X+A[i]-1)//A[i] print(X)