#include <bits/stdc++.h>
using namespace std;
int n;
double p[120] = {0};
double a[120] = {0};
double b[120] = {0};
bool fun(double a, double b) { return b < a; }
int main() {
  int i;
  scanf("%d", &n);
  double mx = -1;
  for (i = 0; i < n; i++) {
    scanf("%lf", &p[i]);
    mx = max(p[i], mx);
  }
  sort(p, p + n, fun);
  a[0] = p[0];
  b[0] = 1 - p[0];
  for (i = 1; i < n; i++) {
    double tmp = a[i - 1] * (1 - p[i]) + b[i - 1] * p[i];
    if (tmp > a[i - 1]) {
      a[i] = tmp;
      b[i] = b[i - 1] * (1 - p[i]);
    } else {
      a[i] = a[i - 1];
      b[i] = b[i - 1];
    }
  }
  printf("%.10lf", max(a[n - 1], mx));
  return 0;
}
