import heapq N = int(input()) A = list(map(int, input().split())) if N==1: print(A[0]) elif N%2==1: print(1) else: heapq.heapify(A) isTurnAlice = True while len(A)>1: x = heapq.heappop(A) y = heapq.heappop(A) if isTurnAlice: heapq.heappush(A,x*y) else: heapq.heappush(A,-(-x//y)) isTurnAlice = not isTurnAlice print(A[0])