#include <bits/stdc++.h>
using namespace std;
long double a[105];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n, greater<long double>());
  long double cur0 = 1.0, cur1 = 0.0;
  for (int i = 0; i < n; i++) {
    double n0 = cur0 * (1 - a[i]);
    double n1 = cur0 * a[i] + cur1 * (1 - a[i]);
    if (n1 > cur1) {
      cur1 = n1;
      cur0 = n0;
    }
  }
  cout << fixed << setprecision(10);
  cout << cur1 << endl;
}
