#include <bits/stdc++.h>
using namespace std;
double x[105];
double prob(int l, int r) {
  double val = 1.0;
  for (int i = l; i <= r; i++) val *= (1 - x[i]);
  double ret = 0.0;
  for (int i = l; i <= r; i++) ret += x[i] * val / (1 - x[i]);
  return ret;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &x[i]);
  for (int i = 0; i < n; i++) {
    if (x[i] == 1.00) {
      printf("%.10lf\n", 1.00);
      return 0;
    }
  }
  sort(x, x + n);
  reverse(x, x + n);
  double mult = x[0];
  double probability = x[0];
  double maxx = -x[0];
  for (int i = 0; i <= n; i++)
    for (int j = i; j <= n; j++)
      if (prob(i, j) > maxx) maxx = prob(i, j);
  printf("%.10lf\n", maxx);
  return 0;
}
