#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 5;
double p[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> p[i];
  sort(p + 1, p + n + 1);
  reverse(p + 1, p + n + 1);
  double one = 0, none = 1;
  for (int i = 1; i <= n; i++) {
    double nw = one * (1 - p[i]) + p[i] * none;
    if (nw > one) {
      one = nw;
      none *= (1 - p[i]);
    } else
      break;
  }
  cout << setprecision(9) << one << endl;
}
