#include <bits/stdc++.h>
using namespace std;
double p[105];
int cmp(double x, double y) { return x > y; }
int main(void) {
  int n;
  int i, j, k;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%lf", &p[i]);
  }
  sort(p, p + n, cmp);
  double ans = 0;
  ans = p[0];
  double temp = 1.0 - p[0];
  for (i = 1; i < n; i++) {
    double sum = 0;
    sum = (1 - p[i]) * ans + temp * p[i];
    if (sum < ans)
      break;
    else {
      ans = sum;
      temp *= 1 - p[i];
    }
  }
  printf("%.15f\n", ans);
  return 0;
}
