#include <bits/stdc++.h>
using namespace std;
int main() {
  cout.precision(10);
  int n;
  cin >> n;
  vector<long double> A;
  for (int i = 0; i < n; i++) {
    long double a;
    cin >> a;
    A.push_back(a);
  }
  sort(A.begin(), A.end());
  long double p = A[n - 1];
  if (p >= 0.5)
    cout << p << endl;
  else {
    long double sum = 0;
    for (int i = n - 1; i >= 0; i--) {
      long double k = 1, pp = 0;
      for (int j = n - 1; j >= i; j--) {
        k = k * (1 - A[j]);
      }
      for (int j = n - 1; j >= i; j--) {
        pp += k * (A[j] / ((long double)1 - A[j]));
      }
      sum = max(pp, sum);
    }
    cout << sum << endl;
  }
}
