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