#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double a[n];
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  double maxi = 0, pro = 1;
  for (int i = n - 1; i > -1; --i) {
    if (maxi * (1 - a[i]) + pro * a[i] > maxi) {
      maxi = maxi * (1 - a[i]) + pro * a[i];
      pro *= (1 - a[i]);
    } else
      break;
  }
  printf("%.9f", maxi);
  return 0;
}
