import java.util.*; import java.io.*; public class Main { public static Scanner sc = new Scanner(System.in); public static PrintWriter pw = new PrintWriter(System.out); public static void main(String[] args) { int T = 1; while( T > 0 ) { solve(); T--; } pw.flush(); } static void solve() { int N = sc.nextInt(); long[] a = new long[N]; for( int i = 0; i < N; i++ ) { a[i] = sc.nextInt(); } Arrays.sort(a); if( N == 1 ) { pw.println(a[0]); }else if( N == 2 ) { pw.println(a[0]*a[1]); }else if( N > 2 && N%2 == 1 ) { pw.println(Math.min(a[0]*a[1],a[2])); }else { pw.println(1); } } }