#include <bits/stdc++.h>
using namespace std;
double p[100];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%lf", p + i);
  sort(p, p + n);
  double best = 0.0;
  for (int i = 0; i < n; ++i) {
    double x = 0.0, y = 1.0;
    for (int j = i; j < n; ++j)
      x = x * (1.0 - p[j]) + y * p[j], y *= (1.0 - p[j]);
    best = max(best, x);
  }
  printf("%.16lf\n", best);
  return 0;
}
