#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const int maxn = 1e6 + 5;
const int N = 1e4 + 5;
const int mod = 1e8;
double p[105];
int cmp(double a, double b) { return a > b; }
int main(void) {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> p[i];
  sort(p + 1, p + 1 + n, cmp);
  double ans = -1, sum, r;
  for (int i = 1; i <= n; i++) {
    sum = 0;
    for (int j = 1; j <= i; j++) {
      r = p[j];
      for (int k = 1; k <= i; k++)
        if (j != k) r *= (1.0 - p[k]);
      sum += r;
    }
    ans = max(ans, sum);
  }
  printf("%.10f\n", ans);
  return 0;
}
