#include <bits/stdc++.h>
using namespace std;
int n;
double pro[101];
double miss[101][101];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> pro[i];
  }
  sort(pro, pro + n);
  for (int i = 0; i < n; ++i) {
    miss[i][i] = 1.0 - pro[i];
    for (int j = i + 1; j < n; ++j) {
      miss[i][j] = miss[i][j - 1] * (1.0 - pro[j]);
    }
  }
  double best = 0.0;
  for (int i = 0; i < n; ++i) {
    for (int j = i; j < n; ++j) {
      double sum = 0.0;
      for (int k = i; k <= j; ++k) {
        sum += pro[k] * (miss[i][j] / (1.0 - pro[k]));
      }
      if (best < sum && sum <= 1.0) {
        best = sum;
      }
    }
  }
  if (best < pro[n - 1]) best = pro[n - 1];
  cout << fixed << setprecision(12) << best << endl;
  return 0;
}
