#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  int n, t, m, l, k, ans, i, j, res = 0, fl;
  t = 1;
  double a[1000];
  while (t--) {
    cin >> n;
    for (i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    double val = a[n - 1];
    double re = 0.0, gre = 0.0, curr = 1.0;
    int lt = n - 1;
    for (j = n - 1; j >= 0; --j) {
      for (int sele = n - 1; sele >= j; --sele) {
        for (l = n - 1; l >= j; --l) {
          if (l == sele)
            curr *= a[l];
          else
            curr *= (1 - a[l]);
        }
        re += curr;
        curr = 1.0;
      }
      gre = max(gre, re);
      re = 0.0;
    }
    cout << setprecision(9) << gre << '\n';
  }
  return 0;
}
