Problem: Andrey needs one more problem to conduct a programming contest. He has n friends who are always willing to help. He can ask some of them to come up with a contest problem. Andrey knows one value for each of his fiends — the probability that this friend will come up with a problem if Andrey asks him.

Help Andrey choose people to ask. As he needs only one problem, Andrey is going to be really upset if no one comes up with a problem or if he gets more than one problem from his friends. You need to choose such a set of people that maximizes the chances of Andrey not getting upset.

Input

The first line contains a single integer n (1 ≤ n ≤ 100) — the number of Andrey's friends. The second line contains n real numbers pi (0.0 ≤ pi ≤ 1.0) — the probability that the i-th friend can come up with a problem. The probabilities are given with at most 6 digits after decimal point.

Output

Print a single real number — the probability that Andrey won't get upset at the optimal choice of friends. The answer will be considered valid if it differs from the correct one by at most 10 - 9.

Examples

Input

4
0.1 0.2 0.3 0.8


Output

0.800000000000


Input

2
0.1 0.2


Output

0.260000000000

Note

In the first sample the best strategy for Andrey is to ask only one of his friends, the most reliable one.

In the second sample the best strategy for Andrey is to ask all of his friends to come up with a problem. Then the probability that he will get exactly one problem is 0.1·0.8 + 0.9·0.2 = 0.26.

Solution (in JAVA):

Solution:
import java.util.*;
import java.math.*;
import java.io.*;
public class B {
    public static long time = 0;
    public static void main(String[] args) throws Exception {
        time = System.currentTimeMillis();
        
        IN = System.in;
        OUT = System.out;
        in = new BufferedReader(new InputStreamReader(IN));
        out = new PrintWriter(OUT, FLUSH);
        solveOne();
        out.flush();
    }
    
    public static void solveOne() throws Exception {
        int n1 = nextInt();
        double[] l1 = new double[n1];
        for (int i = 0; i < l1.length; i++) l1[i] = nextDouble();
        Arrays.sort(l1);
        double ans = 0;
        ArrayList<Double> qq = new ArrayList();
        for (int i = l1.length - 1; i >= 0; i--){
            ans = Math.max(ans, l1[i]);
            qq.add(l1[i]);
            ans = Math.max(ans, simulate(qq));
        }
        printLine(String.format("%.14f", ans));
//      double max = 0;
//      ArrayList<Double> pat = null;
//      for (int i = 0; i < 1 << n1; i++){
//          ArrayList<Double> test = new ArrayList();
//          for (int j = 0; j < n1; j++){
//              if (((1 << j) & i) != 0){
//                  test.add(l1[j]);
//              }
//          }
//          double res = simulate(test);
//          px(String.format("%-10s", Integer.toBinaryString(i)), test, simulate(test));
//          if (res > max){
//              max = res;
//              pat = test;
//          }
//      }
//      px("best", max, pat);
    }
    public static double simulate(ArrayList<Double> l1){
        double fin = 0;
        for (int i = 0 ; i < l1.size(); i++){
            double cur = 1;
            for (int j = 0 ; j < l1.size(); j++){
                if (j == i){
                    cur *= l1.get(j);
                }
                else {
                    cur *= 1.0 - l1.get(j);
                }
            }
            fin += cur;
        }
        return fin;
    }
    
    public static void solveTwo() throws Exception {
        
    }
    
    public static void solveThree() throws Exception {
        
    }
    
    public static BufferedReader in;
    public static StringTokenizer st;
    public static InputStream IN;
    public static OutputStream OUT;
    public static String nextString() throws Exception {
        for (;st == null || !st.hasMoreTokens();){
            String k1 = in.readLine();
            if (k1 == null) return null;
            st = new StringTokenizer(k1);
        }
        return st.nextToken();
    }
    public static int nextInt () throws Exception {
        return Integer.parseInt(nextString());
    }
    public static long nextLong() throws Exception{
        return Long.parseLong(nextString());
    }
    public static double nextDouble() throws Exception{
        return Double.parseDouble(nextString());
    }
    private static int[] nextIntArray(int n1) throws Exception {
        int[] l1 = new int[n1];
        for (int i = 0 ;i < n1; i++){
            l1[i] = nextInt();
        }
        return l1;
    }
    private static long[] nextLongArray(int n1) throws Exception {
        long[] l1 = new long[n1];
        for (int i = 0 ;i < n1; i++){
            l1[i] = nextLong();
        }
        return l1;
    }
    private static int[][] nextIntGrid(int x, int y) throws Exception {
        int[][] l1 = new int[x][y];
        for (int i =0; i < x; i++){
            for (int j = 0; j < y; j++){
                l1[i][j] = nextInt();
            }
        }
        return l1;
    }
    public static void px(Object ... l1){
        System.out.println(Arrays.deepToString(l1));
    }
    public static boolean FLUSH = false;
    public static PrintWriter out;
    public static void print(Object ... l1){
        for (int i = 0; i < l1.length; i++){
            if (i != 0) out.print(' ');
            out.print(l1[i].toString());
        }
    }
    public static void printLine(Object ... l1){
        for (int i = 0; i < l1.length; i++){
            if (i != 0) out.print(' ');
            out.print(l1[i].toString());
        }
        out.println();
    }
    
    public static void printLine(Collection l1){
        boolean first = true;
        for (Object e: l1){
            if (first) first = false;
            else out.print(' ');
            out.print(e.toString());
        }
        out.println();
    }
    
    private static BigInteger bi(long n1){
        return BigInteger.valueOf(n1);
    }
    
    private static double usedTime(){
        return (System.currentTimeMillis()-time)*0.001;
    }
    private static Random usingRandomGenerator = new Random(System.currentTimeMillis());
    private static void sort(double[] l1){
        for (int i = 0 ;  i< l1.length; i++){
            int q = i + usingRandomGenerator.nextInt(l1.length - i);
            double t = l1[i];
            l1[i] = l1[q];
            l1[q] = t;
        }
        Arrays.sort(l1);
    }
    private static void sort(int[] l1){
        for (int i = 0 ;  i< l1.length; i++){
            int q = i + usingRandomGenerator.nextInt(l1.length - i);
            int t = l1[i];
            l1[i] = l1[q];
            l1[q] = t;
        }
        Arrays.sort(l1);
    }
    private static void sort(long[] l1){
        for (int i = 0 ;  i< l1.length; i++){
            int q = i + usingRandomGenerator.nextInt(l1.length - i);
            long t = l1[i];
            l1[i] = l1[q];
            l1[q] = t;
        }
        Arrays.sort(l1);
    }
    
    
    
}