#include <bits/stdc++.h>
using namespace std;
int n;
double prob[111], MaxAns;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%lf", prob + i);
  }
  sort(prob, prob + n);
  reverse(prob, prob + n);
  MaxAns = prob[0];
  for (int i = 0; i < n; i++) {
    double Prob = 1, Sum = 0;
    for (int j = 0; j <= i; j++) {
      Prob *= (1 - prob[j]);
    }
    for (int j = 0; j <= i; j++) {
      Sum += Prob / (1 - prob[j]) * prob[j];
    }
    MaxAns = max(MaxAns, Sum);
  }
  printf("%0.9lf", MaxAns);
}
