#include <bits/stdc++.h>
using namespace std;
double ans, a[10005], k, w;
int n;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = 0; i < n; i++)
    if (a[i] == 1.0) ans = 1.0;
  for (int i = 0; i < n; i++)
    for (int j = i; j < n; j++) {
      w = 0;
      k = 1.0;
      for (int q = i; q <= j; q++) k = k * (1.0 - a[q]);
      for (int q = i; q <= j; q++) w += k / (1.0 - a[q]) * a[q];
      ans = max(ans, w);
    }
  cout << fixed << setprecision(9) << ans << endl;
  cin >> n;
}
