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