#include <bits/stdc++.h>
using namespace std;
const int N = 2000 + 10;
const int MOD = 1e9 + 7;
int n;
double a[N];
void solve() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  double ret = 0;
  for (int i = 0; i < n; ++i) {
    double cur = a[i];
    double v = 1 - a[i];
    for (int j = i - 1; j >= 0; --j) {
      if (cur * (1 - a[j]) + v * a[j] > cur) {
        cur = cur * (1 - a[j]) + v * a[j];
        v *= 1 - a[j];
      }
    }
    ret = max(ret, cur);
  }
  printf("%.10f\n", ret);
}
int main() {
  solve();
  return 0;
}
