#include <bits/stdc++.h>
using namespace std;
double prob[101], ans, nope[101];
void rec(double &prev, int index) {
  if (index < 0) return;
  double curr = nope[index + 1] * (prob[index]) + (prev) * (1 - prob[index]);
  if (curr > prev) {
    prev = curr;
    rec(prev, index - 1);
  } else
    return;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lf", &prob[i]);
  }
  sort(prob, prob + n);
  nope[n - 1] = 1 - prob[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    nope[i] = (1 - prob[i]) * nope[i + 1];
  }
  ans = prob[n - 1];
  rec(ans, n - 2);
  printf("%0.9f", ans);
  return 0;
}
