#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<double> p(N);
  for (int i = (0); i < (N); i++) cin >> p[i];
  sort(p.rbegin(), p.rend());
  double one = p[0], none = 1.0 - p[0];
  double ans = one;
  for (int i = (1); i < (N); i++) {
    one = one * (1.0 - p[i]) + none * p[i];
    none = none * (1.0 - p[i]);
    ans = max(ans, one);
  }
  printf("%.10lf", ans);
}
