#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n;
double p[N];
pair<double, double> dp[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", p + i);
  sort(p + 1, p + 1 + n);
  reverse(p + 1, p + 1 + n);
  double ans = p[1], ret = p[1];
  double A = p[1], B = 1 - p[1];
  for (int i = 2; i <= n; i++) {
    A *= (1 - p[i]);
    A += B * p[i];
    B *= (1 - p[i]);
    ans = max(ans, A);
  }
  printf("%.10f\n", ans);
  return 0;
}
