n = int(input()) a = list(map(int,input().split())) from collections import deque a.sort() q = deque(a) cnt = 1 # print(a) while len(q) > 1: if cnt & 1: a,b = q.pop(),q.pop() q.append(a*b) else: a,b = q.pop(),q.popleft() q.appendleft((-(-b//a))) cnt += 1 print(q.pop())