#include <bits/stdc++.h>
using namespace std;
bool cmp(double a, double b) { return a > b; }
int n;
double a[110], x, sum, ans;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &a[i]);
  sort(a, a + n, cmp);
  ans = 0;
  for (int i = 1; i <= n; i++) {
    sum = 0;
    for (int j = 0; j < i; j++) {
      x = a[j];
      for (int k = 0; k < i; k++) {
        if (j != k) x *= 1 - a[k];
      }
      sum += x;
    }
    ans = max(sum, ans);
  }
  printf("%.12lf\n", ans);
}
