#include <bits/stdc++.h>
using namespace std;
const int N = 105;
double p[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", p + i);
  sort(p, p + n);
  double ans = 0, a = 0, b = 1;
  for (int i = n - 1; i >= 0; i--) {
    if (p[i] == 1) {
      ans = 1;
      break;
    }
    a += (p[i] / (1 - p[i]));
    b *= (1 - p[i]);
    if (a * b > ans) ans = a * b;
  }
  printf("%.10f", ans);
  return 0;
}
