#include <bits/stdc++.h>
using namespace std;
double p[111], q, res;
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%lf", &p[i]);
  sort(p + 1, p + n + 1, greater<double>());
  q = 1.0;
  res = 0;
  for (int i = 1; i <= n; ++i) {
    double t = res * (1.0 - p[i]) + p[i] * q;
    if (res > t) break;
    res = t;
    q *= (1.0 - p[i]);
  }
  printf("%.9lf\n", res);
}
