#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4;
long double p[maxn];
int main() {
  int n;
  long double o = 1;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> p[i];
  sort(p, p + n);
  if (p[n - 1] == 1) {
    cout << "1.000000000000"
         << "\n";
    return 0;
  }
  long double ans = 0;
  for (int i = n - 1; i >= 0; i--) {
    long double tot = 0;
    for (int j = i; j < n; j++) {
      long double res = 1;
      for (int k = i; k < j; k++) res *= (o - p[k]);
      for (int k = j + 1; k < n; k++) res *= (o - p[k]);
      res *= p[j];
      tot += res;
    }
    ans = max(ans, tot);
  }
  cout << setprecision(12) << ans << "\n";
  return 0;
}
