from sys import stdin n, *a = map(int, stdin.read().split()) if n == 1: print("{}".format(a[0])) exit() elif n == 2: print("{}".format(a[0]*a[1])) exit() elif n % 2 == 1: print("{}".format(1)) exit() a.sort() ans = min(a[0]*a[1],a[2]) print("{}".format(ans))