#include <bits/stdc++.h>
using namespace std;
const int MAX = 105;
double p[MAX];
double get(int l, int r) {
  double ans = 0.0;
  for (int i = l; i < r; i++) {
    double res = p[i];
    for (int j = l; j < r; j++)
      if (i != j) res *= (1.0 - p[j]);
    ans += res;
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> p[i];
  sort(p, p + n);
  double ans = 0.0;
  for (int l = 0; l < n; l++)
    for (int r = l + 1; r <= n; r++) ans = max(ans, get(l, r));
  cout << setprecision(12) << fixed << ans << endl;
  return 0;
}
