#include <bits/stdc++.h>
using namespace std;
double a[104];
bool cmp(double a, double b) { return a > b; }
int main() {
  int n;
  while (~scanf("%d", &n)) {
    double max = 0;
    for (int i = 0; i < n; i++) scanf("%lf", &a[i]);
    double sum = 0, t;
    sort(a, a + n, cmp);
    for (int i = 1; i <= n; i++) {
      sum = 0;
      for (int j = 0; j < i; j++) {
        t = a[j];
        for (int k = 0; k < i; k++) {
          if (j != k) t *= (1 - a[k]);
        }
        sum += t;
      }
      if (max < sum) max = sum;
    }
    printf("%.12f\n", max);
  }
  return 0;
}
