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