#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <cmath>
#include <map>
#include <iostream>
#include <limits>
#include <set>

typedef std::pair<int,int> ii;
typedef std::pair<double,double> dd;
typedef long long int Int;
typedef std::vector<int> vi;
typedef std::vector<double> vd;
typedef std::vector<vi> vvi;
typedef std::vector<std::string> vs;
typedef std::vector<ii> vii;

#define sz(X) int((X).size())
#define REP(i,n) for(int i = 0; i < n; ++i)
#define FOR(i,v) for(int i = 0; i < int(v.size()); ++i)
#define ALL(v) v.begin(),v.end()
using namespace std;
char buf[100002];

const double inf = numeric_limits<double>::infinity();
const double eps = 1e-5;

int main(){
    #ifdef LOCAL
    freopen("CF.txt","r",stdin);
    #endif
    int n;
    cin>>n;
    vd p(n);
    for(int j = 0; j<n; ++j) cin>>p[j], p[j] = 1-p[j];
    sort(p.begin(),p.end());
    priority_queue<pair<dd,int> > Q;
    Q.push(make_pair(dd(0.0,1.0),0));
    double mx = 0.0;
    int ctr = 0;
    while(!Q.empty()){
        double Tp = Q.top().first.first;
        double P  = Q.top().first.second;
        int i = Q.top().second;
        Q.pop();
        for(int k = i; k<n; ++k){
            double T = Tp*p[k]+(1-p[k])*P;
            double P2 = P*p[k];
            ++ctr;
            
            // Uncomment & output is correct!!
            //if (ctr == 100)
            	//ctr = 0, cout << T << " " << mx << endl;
            // I have made this "ctr" thing in order to not output too much on ideone's output file
            
            if( T > mx){
                mx = T;
                Q.push(make_pair(dd(T,P2),k+1));
            }
        }
    }
    cout << mx;
    return 0;
}


//  printf("%I64d\n", c1-res);
//      scanf(" %lf",&nums[i]);