#include <bits/stdc++.h>
using namespace std;
int num;
double tmp;
double a[110];
double q[110];
double ans;
bool com(double a, double b) { return a > b; }
int main() {
  while (scanf("%d", &num) != EOF) {
    double m = 0;
    for (int i = 0; i < num; i++) {
      scanf("%lf", &a[i]);
      m = max(m, a[i]);
    }
    q[1] = m;
    sort(a, a + num, com);
    for (int i = 2; i <= num; i++) {
      double tmp1 = 0;
      for (int j = 0; j < i; j++) {
        double tmp2 = 1;
        for (int k = 0; k < i; k++) {
          if (k == j) {
            tmp2 *= a[k];
          } else {
            tmp2 *= ((double)1 - a[k]);
          }
        }
        tmp1 += tmp2;
      }
      m = max(m, tmp1);
    }
    printf("%.12lf\n", m);
  }
}
