from pickle import TRUE n=int(input()) A=list(map(int,input().split())) A.sort(reverse=True) ans=A[0] flag=0 for x in A[1:]: if flag==0: ans*=x else: ans=-(-ans//x) flag=1-flag print(ans)