#include <bits/stdc++.h>
using namespace std;
stringstream ss;
long long mod = 1000000007LL;
double p[128], dp[128][2];
int n;
double f(int pos, int ok) {
  if (pos == n) return ok ? 1 : 0;
  if (ok) return dp[pos][ok] = f(pos + 1, ok) * (1 - p[pos]);
  if (dp[pos][ok] > -.5) return dp[pos][ok];
  double ret = f(pos + 1, 0);
  ret = max(ret, f(pos + 1, 1) * p[pos] + f(pos + 1, 0) * (1 - p[pos]));
  return dp[pos][ok] = ret;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> p[i];
  sort(p, p + n);
  for (int i = 0; i <= n; i++) dp[i][0] = dp[i][1] = -1.;
  printf("%.10lf\n", f(0, 0));
  return 0;
}
