#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
long double fixAngle(long double A) { return A > 1 ? 1 : (A < -1 ? -1 : A); }
double dcmp(double a, double b) {
  return fabs(a - b) < 1e-7 ? 0 : a > b ? 1 : -1;
}
int main() {
  int n;
  cin >> n;
  vector<double> data(n);
  for (int i = 0; i < n; i++) cin >> data[i];
  sort(data.begin(), data.end());
  long double P = 1;
  long double S = 0;
  long double ans = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (dcmp(data[i], 1) == 0) {
      cout << setprecision(9) << fixed << 1.0 << "\n";
      return 0;
    }
    long double newans =
        ans - P * S + P * (1 - data[i]) * (S + data[i] / (1 - data[i]));
    if (newans > ans) {
      ans = newans;
    } else {
      break;
    }
    P *= (1 - data[i]);
    S += data[i] / (1 - data[i]);
  }
  cout << setprecision(9) << fixed << ans << "\n";
  ;
}
