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.io.*; 
import java.lang.reflect.Array; 
import java.math.BigDecimal;
import java.math.BigInteger; 
import java.util.*; 
import java.util.Map.Entry;

import static java.lang.Math.*; 
   
public class solver implements Runnable { 
        final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null; 
        BufferedReader in; 
        PrintWriter out; 
        StringTokenizer tok = new StringTokenizer(""); 
          
        String readString() throws IOException{ 
                while(!tok.hasMoreTokens()){ 
                        try{ 
                                tok = new StringTokenizer(in.readLine()); 
                        }catch (Exception e){ 
                                return null; 
                        } 
                } 
                return tok.nextToken(); 
        } 
        String readString(String delim) throws IOException{ 
            while(!tok.hasMoreTokens()){ 
                    try{ 
                            tok = new StringTokenizer(in.readLine()); 
                    }catch (Exception e){ 
                            return null; 
                    } 
            } 
            return tok.nextToken(delim); 
    } 
         
        int readInt() throws IOException{ 
                return Integer.parseInt(readString()); 
        }   
        long readLong() throws IOException{ 
                return Long.parseLong(readString()); 
        }       
        double readDouble() throws IOException{ 
                return Double.parseDouble(readString()); 
        }  
        char readChar() throws IOException { 
            char val = 0; 
            do{ 
                val = (char) in.read(); 
            }while(val == '\n' || val == '\r'); 
            return val; 
        } 
        char readChar(String skipChars)throws IOException{ 
            char val = 0; 
            boolean ret; 
            do{ 
                val = (char) in.read(); 
                ret = false; 
                for (int i = skipChars.length()-1; i >= 0; i--){ 
                    if (skipChars.charAt(i) == val){ 
                        ret = true; 
                        break; 
                    } 
                } 
            }while(ret); 
            return val; 
        } 
          
        void readIntArray(int[] arr, int start, int count) throws IOException{ 
            for (int i = 0; i < count; i++){ 
                arr[i+start] = readInt(); 
            } 
        } 
          
        public class Pair<T1,T2> { 
            public T1 x1; 
            public T2 x2; 
            public Pair(){}; 
            public Pair(T1 x1, T2 x2){ 
                this.x1 = x1; 
                this.x2 = x2; 
            } 
            public String toString(){ 
                return x1.toString() + " " + x2.toString(); 
            } 
        } 
        public class Point implements Comparable<Point>{ 
            public int x1, x2; 
            public Point(){} 
            public Point(int a, int b){x1 = a;x2=b;} 
            public int compareTo(Point o) { 
                if (x2 == o.x2) return (x1 - o.x1);                 
                return (x2-o.x2);  
                // (x1-o.x1) - increase; -(x1-o.x1) - decrease 
            } 
            public String toString(){ 
                return x1 + ":" + x2; 
            } 
            public boolean equals(Object o){
                Point p = (Point)o;
                return x1 ==p.x2;
            }
        } 
        public class Tree implements Comparable<Tree>{ 
            public int x1, x2, x3; 
            public Tree(){} 
            public Tree(int a, int b, int c){x1 = a;x2=b;x3=c;} 
            public int compareTo(Tree o) {
                if(x1 == o.x1 && x2 == o.x2) return x3-o.x3;
                if(x1 == o.x1) return x2-o.x2;
                return (x1-o.x1);  
                // (x1-o.x1) - increase; -(x1-o.x1) - decrease 
            } 
            public String toString(){ 
                return x1 + ":" + x2 + ":" + x3; 
            } 
        } 
        
        public class Four implements Comparable<Four>{ 
            public int x1, x2;
            boolean x3, x4;
            public Four(){} 
            public Four(int a, int b, int c, int d){x1 = a;x2=b;} 
            public int compareTo(Four o) {
                if(x1 == o.x1) return x2-o.x2;
                return (x1-o.x1);  
                // (x1-o.x1) - increase; -(x1-o.x1) - decrease 
            } 
            public String toString(){ 
                return x1 + ":" + x2 + ":" + x3  + ":" + x4; 
            }
        } 
//----------------------------------------         
        final long con = (long)1e9;
        public void solve() throws IOException {
           int n = readInt();
           BigDecimal[] ans = new BigDecimal[n];
           BigDecimal[] res = new BigDecimal[n];
           BigDecimal[] otr = new BigDecimal[n];
           for (int i = 0; i < n; i++){
               
               ans[i] = new BigDecimal(readDouble());
               res[i] = new BigDecimal("0");
               otr[i] = new BigDecimal("0");
           }
           
           Arrays.sort(ans);
           
           BigDecimal one = BigDecimal.ONE;
           
           res[ans.length-1] = ans[ans.length - 1];
           otr[ans.length-1] = one.subtract(res[ans.length-1]);
           BigDecimal max = res[ans.length-1];
           
           for (int i = ans.length-2; i >= 0; i--){
               BigDecimal ras = one.subtract(ans[i]);
               res[i] = res[i+1].multiply(ras).add(ans[i].multiply(otr[i+1]));
               otr[i] = otr[i+1].multiply(ras);
               if (res[i].compareTo(max) >= 0){
                   max = res[i];
               }
           }
           out.print((max.doubleValue()));
           
           
        }
        
        
        int BinSearch(int[] a, int x, boolean increase){

            int first = 0;
            int last = a.length;
            
            if (increase){
                while (first <= last) {
                    int mid = first + (last - first) / 2;                
                    if (x <= a[mid])
                        last = mid;
                    else
                        first = mid + 1;
                }
                return last;
            }else{
                while (first <= last) {
                    int mid = first + (last - first) / 2;                
                    if (x > a[mid])
                        last = mid;
                    else
                        first = mid + 1;
                }
                return first;
            }
        }
        
          
          
//---------------------------------------- 
        public static void main(String[] args){ 
                new Thread(null, new solver(), "", 256 * (1L << 20)).start(); 
        } 
         
        public void run(){ 
                try{ 
                        timeBegin = System.currentTimeMillis(); 
                        try{ 
                            if (ONLINE_JUDGE){ 
                                in = new BufferedReader(new InputStreamReader(System.in)); 
                                out = new PrintWriter(System.out); 
                            }  
                            else { 
                                in = new BufferedReader(new FileReader("input.txt")); 
                                out = new PrintWriter("output.txt"); 
                            } 
                        }catch(Throwable e){
                            in = new BufferedReader(new InputStreamReader(System.in)); 
                            out = new PrintWriter(System.out); 
                        }
                          
                        solve(); 
                        out.close(); 
                          
                        timeEnd = System.currentTimeMillis(); 
                        System.err.println("Time = " + (timeEnd - timeBegin)); 
                }catch (Exception e){ 
                        e.printStackTrace(System.err); 
                        System.exit(-1); 
                } 
        } 
         
        long timeBegin, timeEnd; 
   
          
//----------             
        void update(int[] doo, int v, int i, int val, int ll, int rr){ 
            if (ll == rr){ 
                doo[v] = val; 
            }else{ 
                int med = ll + ((rr-ll)>>1); 
                  
                if (i <= med){ 
                    update(doo, v<<1, i, val, ll, med); 
                }else{ 
                    update(doo, (v<<1)+1, i, val, med+1, rr); 
                } 
                doo[v] = min(doo[v<<1],doo[(v<<1)+1]); 
            } 
        } 
        int get(int[] doo, int v, int l, int r, int ll, int rr){ 
            if (l > r){ 
                return Integer.MAX_VALUE; 
            } 
            if (ll == l && r == rr){ 
                return doo[v]; 
            } 
            int med = ll + ((rr-ll)>>1);
            return min(get(doo, v<<1, l, min(r, med), ll, med),  
                    get(doo, (v<<1)+1, max(l, med+1), r, med+1, rr)); 
        } 
 //----------------------------------------
}