#include <bits/stdc++.h>
using namespace std;
double num[105];
double nnum[105];
double gai[105];
bool cmp(double d1, double d2) { return d1 > d2; }
int main() {
  int n;
  cin >> n;
  int i = 0;
  while (cin >> num[i++])
    ;
  sort(num, num + n, cmp);
  double temp = 1;
  for (i = 0; i < n; i++) {
    nnum[i] = 1 - num[i];
    temp *= nnum[i];
    gai[i] = temp;
  }
  double maxd = num[0];
  double tempmax;
  for (i = 2; i <= n; i++) {
    temp = gai[i - 1];
    tempmax = 0;
    for (int j = 0; j < i; j++) {
      tempmax += temp / nnum[j] * num[j];
    }
    if (maxd < tempmax) maxd = tempmax;
  }
  cout << setprecision(13) << maxd;
  return 0;
}
