#include <bits/stdc++.h>
using namespace std;
const int MAXN = 105;
double p[MAXN];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &p[i]);
  sort(p, p + n);
  reverse(p, p + n);
  double res0 = 1.0 - p[0];
  double res1 = p[0];
  for (int i = 1; i < n; i++) {
    double nRes0 = res0 * (1.0 - p[i]);
    double nRes1 = res0 * p[i] + res1 * (1.0 - p[i]);
    if (nRes1 < res1) break;
    res0 = nRes0;
    res1 = nRes1;
  }
  printf("%.10lf\n", res1);
  return 0;
}
