#include <bits/stdc++.h>
using namespace std;
double p[1005];
int main() {
  int n;
  double q = 1.0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> p[i];
    q = q * (1.0 - p[i]);
  }
  sort(p, p + n, greater<double>());
  double mx = p[0];
  vector<int> vec;
  for (int fr = 1; fr <= n; fr++) {
    double x = 1.0;
    double tmp = 0.0;
    double q = 1.0;
    for (int j = 0; j < fr; j++) {
      q = q * (1 - p[j]);
    }
    for (int j = 0; j < fr; j++) {
      double q1 = q / (1 - p[j]);
      q1 = q1 * p[j];
      tmp += q1;
    }
    mx = max(mx, tmp);
  }
  printf("%0.9f\n", mx);
  return 0;
}
