#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
double p[105];
double prod[105], sum[105];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> p[i];
  sort(p, p + n);
  if (p[n - 1] == 1)
    cout << setprecision(9) << p[n - 1] << "\n";
  else {
    sum[n] = static_cast<double>(0), prod[n] = static_cast<double>(1);
    for (int i = n - 1; i >= 0; --i) {
      sum[i] += sum[i + 1] + p[i] / (static_cast<double>(1) - p[i]);
      prod[i] = prod[i + 1] * (static_cast<double>(1) - p[i]);
    }
    double ans = static_cast<double>(0);
    for (int i = n - 1; i >= 0; --i) {
      if (sum[i] * prod[i] - ans > eps) {
        ans = sum[i] * prod[i];
      }
    }
    cout << setprecision(9) << ans << "\n";
  }
  return 0;
}
