#include <bits/stdc++.h>
using namespace std;
bool pred(double x, double y) { return x > y; }
int main() {
  int n;
  cin >> n;
  static vector<double> p(n);
  for (int i = 0; i < n; ++i) cin >> p[i];
  sort(p.begin(), p.end(), pred);
  static vector<double> p1(n);
  for (int i = 0; i < n; ++i) p1[i] = 1 - p[i];
  double mp = p[0];
  double pp = p1[0];
  for (int i = 1; i < n; ++i) {
    double cp = mp * p1[i] + pp * p[i];
    if (cp <= mp) break;
    mp = cp;
    pp *= p1[i];
  }
  cout << setprecision(12);
  cout << mp << endl;
}
