#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 5;
const double eps = 1e-8;
double pi[maxn], sp[maxn];
bool _eq(double a, double b) { return (a > b - eps) && (a < b + eps); }
int main() {
  int n;
  double ans = 0;
  cin >> n;
  sp[0] = 1;
  for (int i = 1; i <= n; i++) cin >> pi[i];
  sort(&pi[1], &pi[n + 1], greater<double>());
  if (_eq(pi[1], 1)) return printf("%.12lf\n", 1.0) & 0;
  for (int i = 1; i <= n; i++) sp[i] = sp[i - 1] * (1 - pi[i]);
  for (int i = 1; i <= n; i++) {
    double tans = 0;
    for (int j = 1; j <= i; j++) tans += pi[j] * sp[i] / (1 - pi[j]);
    ans = max(ans, tans);
  }
  printf("%.12lf\n", ans);
  return 0;
}
