#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  priority_queue<double> pq;
  cin >> n;
  double p;
  int c = n;
  while (c--) {
    cin >> p;
    pq.push(p);
  }
  double np = 1, lp, x;
  p = 0;
  do {
    lp = p;
    x = pq.top();
    pq.pop();
    p *= (1 - x);
    p += np * x;
    if (p > lp) {
      np *= (1 - x);
    } else {
      p = lp;
    }
  } while (--n);
  printf("%.12f\n", p);
  return 0;
}
