#include <bits/stdc++.h>
using namespace std;
double a[101];
long long n;
int main() {
  long long t = 1;
  while (t--) {
    cin >> n;
    for (long long i = 0, _n = (n); i < _n; i++) {
      cin >> a[i];
    }
    double prob = 0;
    sort(a, a + n);
    if (a[n - 1] >= 0.5) {
      cout << a[n - 1];
      return 0;
    }
    for (long long j = 1; j <= n; j++) {
      double val = 0;
      for (long long i = n - 1; i > n - 1 - j; i--) {
        double prod = 1;
        for (long long k = n - j; k < n; k++) {
          if (k == i) {
            prod *= a[k];
          } else {
            prod *= (1 - a[k]);
          }
        }
        val += prod;
      }
      prob = max(prob, val);
    }
    printf("%.9f", prob);
  }
}
