#include <bits/stdc++.h>
using namespace std;
int n;
vector<double> a;
double y[105], no[105];
double temp;
double find(int p) {
  int i;
  double val = 1, x = 0;
  for (i = p - 1; i < a.size(); i++) x += val * y[i], val *= (1 - a[i]);
  return x;
}
int main() {
  cin >> n;
  while (n--) cin >> temp, a.push_back(temp);
  sort(a.begin(), a.end());
  y[a.size()] = no[a.size()] = 1;
  int i;
  for (i = a.size() - 1; i >= 0; i--)
    y[i] = a[i] * no[i + 1], no[i] = (1 - a[i]) * no[i + 1];
  i = 0;
  for (i = 1; i <= a.size(); i++) temp = (find(i) > temp) ? find(i) : temp;
  printf("%0.13lf\n", temp);
  return 0;
}
