#include <bits/stdc++.h>
using namespace std;
int n;
double p[200];
vector<pair<double, double> > cur[2];
int main() {
  cin >> n;
  double ans = 0;
  for (int i = 0; i < n; i++) cin >> p[i];
  cur[1].push_back(make_pair(0, 1));
  sort(p, p + n);
  reverse(p, p + n);
  for (int i = 0; i < n; i++) {
    cur[0].clear();
    for (int j = 0; j < (int)cur[1].size(); j++) {
      ans = max(cur[1][j].first, ans);
      if (j > 50000) break;
      cur[0].push_back(cur[1][j]);
    }
    cur[1].clear();
    sort(cur[0].rbegin(), cur[0].rend());
    double best = -1;
    for (int j = 0; j < (int)cur[0].size(); j++) {
      if (cur[0][j].second <= best) continue;
      best = cur[0][j].second;
      if (cur[0][j].second + cur[0][j].first <= ans + 7e-10) continue;
      cur[1].push_back(cur[0][j]);
      if (cur[0][j].first <= cur[0][j].second)
        cur[1].push_back(
            make_pair(cur[0][j].second * p[i] + cur[0][j].first * (1 - p[i]),
                      cur[0][j].second * (1 - p[i])));
    }
  }
  for (int i = 0; i < (int)cur[1].size(); i++) {
    ans = max(ans, cur[1][i].first);
  }
  cout.precision(20);
  cout << ans << "\n";
}
