#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<double> p;
  for (int i = 0; i < n; ++i) {
    double x;
    cin >> x;
    if (x == 1.0) {
      cout << "1";
      return 0;
    }
    if (x > 0.0) p.push_back(x);
  }
  if (p.size() == 0) {
    cout << "0";
    return 0;
  }
  double odp = 0.0;
  sort(p.begin(), p.end());
  double P = 1.0, S = 0.0;
  for (int i = n - 1; i >= 0; --i) {
    P *= (1.0 - p[i]);
    S += p[i] / (1.0 - p[i]);
    odp = max(odp, P * S);
  }
  cout << fixed << setprecision(10);
  cout << odp;
  return 0;
}
