#include <bits/stdc++.h>
using namespace std;
double a[102];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  double p = 1 - a[n - 1];
  double ans = a[n - 1];
  double s = a[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    s = s * (1 - a[i]) + p * a[i];
    p = p * (1 - a[i]);
    ans = max(ans, s);
  }
  printf("%.12lf", ans);
}
