#include <bits/stdc++.h>
using namespace std;
int main() {
  cout << fixed << setprecision(10);
  int n;
  double p[109];
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> p[i];
  sort(p + 1, p + n + 1);
  double pr = p[n], sr = 1 - p[n];
  int i = n - 1;
  while (sr > pr and i >= 1) {
    pr = pr * (1 - p[i]) + sr * p[i];
    sr = (1 - p[i]) * sr;
    i--;
  }
  cout << pr;
}
