#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]);
I2luY2x1ZGUgPGNzdGRpbz4KI2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPHF1ZXVlPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8Y3N0cmluZz4KI2luY2x1ZGUgPGNtYXRoPgojaW5jbHVkZSA8bWFwPgojaW5jbHVkZSA8aW9zdHJlYW0+CiNpbmNsdWRlIDxsaW1pdHM+Ci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4wLDEuMCksMCkpOwogICAgZG91YmxlIG14ID0gMC4wOwogICAgaW50IGN0ciA9IDA7CiAgICB3aGlsZSghUS5lbXB0eSgpKXsKICAgICAgICBkb3VibGUgVHAgPSBRLnRvcCgpLmZpcnN0LmZpcnN0OwogICAgICAgIGRvdWJsZSBQICA9IFEudG9wKCkuZmlyc3Quc2Vjb25kOwogICAgICAgIGludCBpID0gUS50b3AoKS5zZWNvbmQ7CiAgICAgICAgUS5wb3AoKTsKICAgICAgICBmb3IoaW50IGsgPSBpOyBrPG47ICsrayl7CiAgICAgICAgICAgIGRvdWJsZSBUID0gVHAqcFtrXSsoMS1wW2tdKSpQOwogICAgICAgICAgICBkb3VibGUgUDIgPSBQKnBba107CiAgICAgICAgICAgICsrY3RyOwogICAgICAgICAgICAKICAgICAgICAgICAgLy8gVW5jb21tZW50ICYgb3V0cHV0IGlzIGNvcnJlY3QhIQogICAgICAgICAgICAvL2lmIChjdHIgPT0gMTAwKQogICAgICAgICAgICAJLy9jdHIgPSAwLCBjb3V0IDw8IFQgPDwgIiAiIDw8IG14IDw8IGVuZGw7CiAgICAgICAgICAgIC8vIEkgaGF2ZSBtYWRlIHRoaXMgImN0ciIgdGhpbmcgaW4gb3JkZXIgdG8gbm90IG91dHB1dCB0b28gbXVjaCBvbiBpZGVvbmUncyBvdXRwdXQgZmlsZQogICAgICAgICAgICAKICAgICAgICAgICAgaWYoIFQgPiBteCl7CiAgICAgICAgICAgICAgICBteCA9IFQ7CiAgICAgICAgICAgICAgICBRLnB1c2gobWFrZV9wYWlyKGRkKFQsUDIpLGsrMSkpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgY291dCA8PCBteDsKICAgIHJldHVybiAwOwp9CgoKLy8gIHByaW50ZigiJUk2NGRcbiIsIGMxLXJlcyk7Ci8vICAgICAgc2NhbmYoIiAlbGYiLCZudW1zW2ldKTs=
MTAwCjAuMDEgMC4wMSAwLjAxIDAuMDEgMC4wMSAwLjAxIDAuMDEgMC4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