#include <bits/stdc++.h>
using namespace std;
int n;
double A[105], t, olmama, mx, x = 1;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lf", &A[i]);
  }
  sort(A + 1, A + n + 1);
  for (int i = n; i >= 1; i--) {
    if (mx * (1 - A[i]) + x * A[i] < mx)
      break;
    else {
      mx = mx * (1 - A[i]) + x * A[i];
      x *= (1 - A[i]);
    }
  }
  printf("%.12lf", mx);
  return 0;
}
