#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000;
int n;
double p[maxn], s[maxn], a[maxn], ans, sum[maxn];
int main() {
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(9) << endl;
  cin >> n;
  s[0] = 1;
  for (int i = 1; i <= n; i++) {
    cin >> p[i];
    if (p[i] == 1.0) {
      cout << 1.0 << endl;
      return 0;
    }
  }
  sort(p + 1, p + n + 1);
  for (int i = 1; i <= n; i++) {
    s[i] = s[i - 1] * (1 - p[i]);
    a[i] = p[i] / (1 - p[i]);
    sum[i] = sum[i - 1] + a[i];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j++) {
      ans = max(ans, (sum[j] - sum[i - 1]) * s[j] / s[i - 1]);
    }
  }
  cout << ans << endl;
  return 0;
}
