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