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