#include <bits/stdc++.h>
using namespace std;
int n;
bool comp(double a, double b) {
  return (a - b) > ((fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * 1e-9);
}
vector<double> a;
double getSum(int i, int j) {
  double ret = 0, sum = 1;
  for (int k = i; k <= j; k++) sum = sum * (1.0 - (a[k] * 1.0));
  for (int k = i; k <= j; k++) ret += (a[k] * sum) / (1.0 - (a[k] * 1.0));
  return ret;
}
int main(int argc, char **argv) {
  cin >> n, a.resize(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  stable_sort(a.begin(), a.end());
  if (a[a.size() - 1] == 1.0) {
    cout << "1.0";
    return 0;
  }
  double temp, ans = 0.0;
  for (int i = 0; i < n; i++) {
    for (int j = i; j < n; j++) {
      temp = getSum(i, j);
      if (comp(temp, ans)) ans = temp;
    }
  }
  cout.precision(12);
  cout << ans << endl;
  return 0;
}
