#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n;
  double prob[101] = {}, ans = 0, pro = 1;
  cin >> n;
  for (i = 0; i < n; i++) cin >> prob[i];
  sort(prob, prob + n, greater<double>());
  i = 0;
  while (i < n && (pro - ans) * prob[i] > 0.000000001) {
    ans = (ans * (1 - prob[i])) + (pro * prob[i]);
    pro *= (1 - prob[i++]);
  }
  printf("%.12lf", ans);
}
