#include <bits/stdc++.h>
using namespace std;
double num[105];
int cmp(double a, double b) { return a > b; }
int main(void) {
  double a, b, x, tmpb, tmpa;
  int n, i;
  a = 1, b = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%lf", &num[i]);
  sort(num, num + n, cmp);
  for (i = 0; i < n; i++) {
    x = num[i];
    tmpb = a * x + b * (1 - x);
    tmpa = a * (1 - x);
    if (tmpb > b) b = tmpb, a = tmpa;
  }
  printf("%.9f\n", b);
  return 0;
}
