#include <bits/stdc++.h>
using namespace std;
const int maxn = 5005;
int n;
double p[maxn];
void input() {
  for (register int i = 1; i <= n; i++) {
    scanf("%lf", &p[i]);
  }
  sort(p + 1, p + n + 1);
}
void solve() {
  if (p[n] >= 0.5) {
    printf("%.9lf\n", p[n]);
    return;
  }
  double ans = 0, cn, nw, s = 1;
  for (register int i = n; i >= 1; i--) {
    nw = ans * (1 - p[i]) + s * p[i];
    if (nw > ans) {
      ans = nw;
      s *= 1 - p[i];
    } else {
      break;
    }
  }
  printf("%.9lf\n", ans);
}
int main() {
  while (scanf("%d", &n) != EOF) {
    input();
    solve();
  }
  return 0;
}
