#include <bits/stdc++.h>
using namespace std;
double f(vector<double>& a) {
  int n = a.size();
  double ans = 0;
  for (int i = 0; i < n; i++) {
    double cur = a[i];
    for (int j = 0; j < n; j++) {
      if (j != i) cur *= (1 - a[j]);
    }
    ans += cur;
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  vector<double> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  double ans = 0;
  for (int k = 1; k <= n; k++) {
    for (int l = 0; l <= k; l++) {
      int r = k - l;
      vector<double> a;
      for (int i = 0; i < l; i++) a.push_back(v[i]);
      for (int i = n - r; i < n; i++) a.push_back(v[i]);
      double cur = f(a);
      ans = max(ans, cur);
    }
  }
  cout << setprecision(11) << ans << endl;
  return 0;
}
