N = int(input()) A = sorted(map(int, input().split())) if N == 1: ans = A[0] elif N == 2: ans = A[0] * A[1] elif N % 2: ans = 1 else: ans = min(A[0] * A[1], A[2]) print(ans)