#include <bits/stdc++.h>
using namespace std;
double a[105];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i]);
  sort(a + 1, a + n + 1);
  double ans = a[n], cant = 1 - a[n];
  for (int i = n - 1; i >= 1; i--) {
    if (ans < ans * (1 - a[i]) + cant * a[i])
      ans = ans * (1 - a[i]) + cant * a[i], cant *= (1 - a[i]);
  }
  printf("%.9lf", ans);
}
