n = int(input()) A = list(map(int, input().split())) A.sort() from collections import deque A = deque(A) for i in range(n-1): if i%2 == 0: x = A.popleft() y = A.pop() A.append(x*y) else: y = A.pop() x = A.pop() A.appendleft((x+y-1)//y) print(A[0])