#include <bits/stdc++.h>
using namespace std;
typedef struct {
  double p;
  double np;
} fd;
bool operator<(const fd &a, const fd &b) {
  if (a.p > b.p) {
    return true;
  }
  return false;
}
int main(void) {
  int n;
  cin >> n;
  vector<fd> arr(n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i].p;
    arr[i].np = 1 - arr[i].p;
  }
  sort(arr.begin(), arr.end());
  double max = arr[0].p;
  for (int i = 1; i < n; i++) {
    double prob = 0;
    for (int j = 0; j <= i; j++) {
      double pp = arr[j].p;
      for (int x = 0; x <= i; x++) {
        if (x != j) {
          pp *= arr[x].np;
        }
      }
      prob += pp;
    }
    if (max < prob) {
      max = prob;
    }
  }
  printf("%.12lf\n", max);
  return 0;
}
