#include <bits/stdc++.h>
using namespace std;
const int MAXN = 105;
const int EPS = 1e-12;
double p[MAXN];
int main(void) {
  int n;
  scanf(" %d", &n);
  for (int i = 0; i < n; i++) {
    scanf(" %lf", &p[i]);
  }
  sort(p, p + n);
  reverse(p, p + n);
  if (p[0] >= 1 - EPS) {
    printf("%.12f\n", p[0]);
  } else {
    double prod = 1 - p[0];
    double sum = p[0] / (1 - p[0]);
    double res = prod * sum;
    for (int i = 1; i < n; i++) {
      prod *= (1 - p[i]);
      sum += p[i] / (1 - p[i]);
      res = max(res, prod * sum);
    }
    printf("%.12f\n", res);
  }
  return 0;
}
