#yuki1816 n=int(input()) a=sorted(list(map(int,input().split()))) if n==1: print(a[0]) elif n==2: print(a[0]*a[1]) elif a%2: print(1) else: print(min(a[0]*a[1],a[2]))