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.pop() y = A.pop() A.append(x*y) else: x = A.popleft() y = A.pop() A.appendleft((x+y-1)//y) print(A[0])