#include <bits/stdc++.h>
using namespace std;
vector<double> v;
vector<double>::iterator it;
int main() {
  int n, i, j;
  double a[111];
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%lf", &a[i]);
  double ans = -1.0;
  for (i = 0; i < n; i++) {
    v.push_back(a[i]);
    ans = max(ans, a[i]);
  }
  if (n == 1) {
    printf("%.10lf\n", a[0]);
    return 0;
  }
  sort(v.begin(), v.end());
  if (v.size() == 0) {
    printf("%.10lf\n", ans);
    return 0;
  }
  for (i = (int)v.size() - 1; i >= 0; i--) {
    for (j = i - 1; j >= 0; j--) {
      double c = 0.0;
      for (int k = j; k <= i; k++) c = c + (v[k] / (1.0 - v[k]));
      for (int k = j; k <= i; k++) c = c * (1.0 - v[k]);
      ans = max(ans, c);
    }
  }
  printf("%.10lf\n", ans);
  return 0;
}
