#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000007;
const double eps = 1e-10;
const int MAXN = 1000010;
int n;
double ans;
double d[110];
double get(int x) {
  double now = 0.0;
  double yy = 1.0;
  for (int i = 0; i <= x; i++) yy *= (1 - d[i]);
  for (int i = 0; i <= x; i++) {
    now += yy / (1 - d[i]) * d[i];
  }
  return now;
}
int main() {
  scanf("%d", &n);
  ans = 0.0;
  for (int i = 0; i < (n); ++i) {
    scanf("%lf", &d[i]);
    ans = max(ans, d[i]);
  }
  sort(d, d + n);
  reverse(d, d + n);
  for (int i = 0; i < n; i++) {
    double now = get(i);
    ans = max(ans, now);
  }
  printf("%.9lf\n", ans);
  return 0;
}
