#include <bits/stdc++.h>
using namespace std;
double dp[106][106];
double ans[106];
bool cmp(double x, double y) { return x > y; }
int main(void) {
  int n;
  while (scanf("%d", &n) != EOF) {
    int i, j;
    for (i = 0; i < n; i++) {
      scanf("%lf", &ans[i]);
    }
    sort(ans, ans + n, cmp);
    double maxx = ans[0];
    double x = (1 - ans[0]);
    if (ans[0] != 1) {
      double y = ans[0] / (1 - ans[0]);
      for (i = 1; i < n; i++) {
        double d = -x * y + x * (1 - ans[i]) * (y + ans[i] / (1 - ans[i]));
        x *= (1 - ans[i]);
        y += ans[i] / (1 - ans[i]);
        if (d <= 0)
          break;
        else
          maxx = maxx + d;
      }
    }
    printf("%.10f\n", maxx);
  }
  return 0;
}
