#include <bits/stdc++.h>
using namespace std;
vector<double> A;
int main() {
  double maxi = 0.0;
  int n;
  cin >> n;
  A.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    maxi = max(A[i], maxi);
  }
  if (n == 1) {
    cout << A[0];
    return 0;
  }
  if (maxi >= 0.5) {
    cout << maxi;
    return 0;
  }
  sort(A.begin(), A.end());
  maxi = A[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    double temp = 0.0;
    for (int j = i; j < n; j++) {
      double temp2 = 1.0;
      for (int k = i; k < n; k++) {
        if (k == j)
          temp2 *= A[k];
        else
          temp2 *= (1 - A[k]);
      }
      temp += temp2;
    }
    if (temp >= maxi)
      maxi = temp;
    else
      break;
  }
  cout << setprecision(12);
  cout << fixed << maxi;
  return 0;
}
