#include <bits/stdc++.h>
using namespace std;
template <class _T>
inline string tostr(const _T& a) {
  ostringstream os("");
  os << a;
  return os.str();
}
const int MAXN = 110;
double in[MAXN];
int main() {
  int n;
  while (cin >> n) {
    for (int(i) = (0); (i) < (n); ++(i)) cin >> in[i];
    sort(in, in + n, greater<double>());
    double resp = in[0];
    cerr << "resp"
         << " = " << resp << endl;
    ;
    for (int(i) = (1); (i) < (n); ++(i)) {
      double nresp = 0;
      for (int(j) = (0); (j) < (i + 1); ++(j)) {
        double aux = in[j];
        for (int(k) = (0); (k) < (i + 1); ++(k)) {
          if (k != j) aux *= (1 - in[k]);
        }
        nresp += aux;
      }
      if (nresp > resp)
        resp = nresp;
      else
        break;
    }
    printf("%.10lf\n", resp);
  }
  return 0;
}
