#include <bits/stdc++.h>
double max(double x, double y) {
  if (x > y) return x;
  return y;
}
double x[105];
int main() {
  int n;
  scanf("%d", &n);
  double p = 0, g = 1;
  for (int i = 1; i <= n; i++) scanf("%lf", &x[i]);
  std::sort(x + 1, x + n + 1);
  for (int i = n; i >= 1; i--) {
    if (p * (1 - x[i]) + x[i] * g > p) {
      p = p * (1 - x[i]) + x[i] * g;
      g *= 1 - x[i];
    }
  }
  printf("%.10f", p);
}
