#include <bits/stdc++.h>
using namespace std;
const int mx = 100 + 10;
int n;
double p[mx];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%lf", &p[i]);
  }
  sort(p + 1, p + n + 1);
  double ans = p[n];
  double temp = 1 - p[n];
  for (int i = n - 1; i >= 1; --i) {
    if (temp - ans >= 0.0) {
      ans = ans * (1 - p[i]) + p[i] * temp;
      temp = temp * (1 - p[i]);
    } else {
      break;
    }
  }
  printf("%.12f\n", ans);
}
