from re import X n = int(input()) a = list(map(int,input().split())) a.sort(reverse = True) ans = a[0] for i in range(1, n): if i % 2 == 1: ans *= a[i] else: ans = (a[n - i - 1] + ans - 1) // ans print(ans)