#include <bits/stdc++.h>
using namespace std;
double p[101];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  set<pair<double, double> > st;
  set<pair<double, double> > st2;
  set<pair<double, double> > st3;
  for (int i = 0; i < n; ++i) {
    cin >> p[i];
  }
  sort(p, p + n, greater<double>());
  for (int i = 0; i < n; ++i) {
    if (st.empty()) {
      st.insert({p[i], 1 - p[i]});
      continue;
    }
    for (auto x : st) {
      pair<double, double> z = {x.second * p[i] + x.first * (1 - p[i]),
                                x.second * (1 - p[i])};
      if (z.first > x.first) {
        st2.insert(z);
        if (z.second < x.second) st3.insert(x);
      }
    }
    st.insert(st2.begin(), st2.end());
    for (auto x : st3) st.erase(x);
    st2.clear();
    st3.clear();
  }
  auto it = st.lower_bound({1, 0});
  double z = it->first;
  if (it != st.begin()) {
    --it;
    if (fabs(1 - z) > fabs(1 - it->first)) z = it->first;
  }
  cout << std::setprecision(9) << z << '\n';
  return 0;
}
