#include <bits/stdc++.h>
using namespace std;
int n, idx = -1;
int main() {
  double a[105], val, v;
  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] < 0.5) idx = i;
  double ans = a[n - 1];
  for (int i = 2; i <= n; i++) {
    val = 1, v = 0;
    for (int j = idx, k = 0; j >= 0 && k < i; j--, k++) val *= (1 - a[j]);
    for (int j = idx, k = 0; j >= 0 && k < i; j--, k++)
      v += val * a[j] / (1 - a[j]);
    ans = max(ans, v);
  }
  cout << fixed << setprecision(12) << ans;
  return 0;
}
