#include <bits/stdc++.h>
using namespace std;
double eps = 1e-10;
int main() {
  int n;
  cin >> n;
  double arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  double mx = 0.0;
  for (int i = 0; i < n; i++) {
    double lose = 1.0;
    for (int j = i; j < n; j++) {
      double tmp = 0.0;
      for (int k = i; k <= j; k++) {
        lose = 1.0;
        for (int kk = i; kk <= j; kk++) {
          if (kk == k) continue;
          if (lose == 0.0) lose = 1.0;
          lose *= 1.0 - arr[kk];
        }
        tmp += arr[k] * lose;
      }
      if (tmp - mx > 1e-9) mx = tmp;
    }
  }
  cout << fixed << setprecision(10) << mx;
  return 0;
}
