#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6;
const int INF = -0x3f3f3f3f;
const double eps = 1e-8;
int main() {
  int n;
  cin >> n;
  double s, p[110], ans = 0.0;
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }
  sort(p, p + n);
  ans = p[n - 1];
  for (int k = 1; k <= n; k++) {
    s = 1.0;
    p[n] = 0.0;
    for (int i = n - 1; i >= n - k; i--) {
      for (int j = n - 1; j >= n - k; j--) {
        if (j == i) {
          s *= p[j];
        } else
          s *= (double)(1.0 - p[j]);
      }
      p[n] += s;
      s = 1.0;
    }
    ans = max(p[n], ans);
  }
  printf("%.12lf\n", ans);
  return 0;
}
