#include <bits/stdc++.h>
using namespace std;
const int N = 100;
int n;
double p[N];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%lf", &p[i]);
  sort(p, p + n);
  if (p[n - 1] == 1) {
    puts("1.000000000000");
    return 0;
  }
  double res = 0, sum = 0, mul = 1;
  for (int i = n - 1; i >= 0; --i) {
    sum += p[i] / (1 - p[i]);
    mul *= 1 - p[i];
    res = max(res, sum * mul);
  }
  printf("%.12lf\n", res);
  return 0;
}
