#include <bits/stdc++.h>
using namespace std;
int n, now;
double a[110], ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i]);
  sort(a + 1, a + n + 1);
  ans = a[n];
  for (int i = 1; i <= n; i++)
    if (a[i] >= 0.5) {
      n = i - 1;
      break;
    }
  for (int k = 1; k <= n; k++) {
    double tmp = 1.0, ret = 0;
    for (int i = n; i >= n - k + 1; i--) {
      tmp = tmp * (1 - a[i]);
    }
    for (int i = n; i >= n - k + 1; i--) ret += a[i] * tmp / (1 - a[i]);
    ans = max(ret, ans);
  }
  printf("%.10lf\n", ans);
  return 0;
}
