#include <bits/stdc++.h>
using namespace std;
const int INF = 111;
double f[INF];
int cmp(double a, double b) { return a > b; }
int main() {
  double ans = 0, k = 0, an = 0;
  cout.setf(ios::fixed);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%lf", &f[i]);
  sort(f + 1, f + 1 + n, cmp);
  for (int p = 1; p <= n; p++) {
    an = 0;
    for (int i = 1; i <= p; i++) {
      k = 1.0;
      for (int j = 1; j <= p; j++) {
        if (i != j)
          k *= (1 - f[j]);
        else
          k *= f[j];
      }
      an += k;
    }
    ans = max(an, ans);
  }
  cout << setprecision(12) << ans << endl;
  return 0;
}
