#include <bits/stdc++.h>
int dr[] = {2, 2, -2, -2, 1, -1, 1, -1};
int dc[] = {1, -1, 1, -1, 2, 2, -2, -2};
int dr1[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dc1[] = {1, -1, 1, 0, -1, 0, 1, -1};
int dr2[] = {0, 0, 1, -1};
int dc2[] = {1, -1, 0, 0};
using namespace std;
int main() {
  long long int n, i, j, k;
  double a[105], tot, m, max1;
  while (cin >> n) {
    max1 = 0;
    for (i = 1; i <= n; i++) {
      cin >> a[i];
    }
    sort(a + 1, a + n + 1);
    for (i = n; i >= 1; i--) {
      tot = 0;
      for (j = i; j <= n; j++) {
        m = 1;
        for (k = i; k <= n; k++) {
          if (k != j) m *= (1 - a[k]);
        }
        tot = tot + (m * a[j]);
      }
      max1 = max(max1, tot);
    }
    printf("%.12lf\n", max1);
  }
  return 0;
}
