#include <bits/stdc++.h>
using namespace std;
double p[100];
bool comp(const double &a, const double &b) { return a > b; }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &p[i]);
  sort(p, p + n, comp);
  double ans = 0.0;
  double all_failed = 1.0, successed = 0.0;
  for (int i = 0; i < n; i++) {
    successed = successed * (1 - p[i]) + all_failed * p[i];
    all_failed *= (1 - p[i]);
    if (successed > ans) ans = successed;
  }
  printf("%.12lf", ans);
  return 0;
}
