#include <bits/stdc++.h>
using namespace std;
const int N = 111;
double p[N];
bool added[N];
int n;
signed main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = (1); i <= (n); i++) {
    cin >> p[i];
  }
  sort(p + 1, p + n + 1, std::greater<double>());
  double s = 0;
  vector<double> v;
  for (int i = (1); i <= (n); i++) {
    s += p[i] / (1 - p[i]);
    v.push_back(p[i]);
    if (s > 1) break;
  }
  double ans = 0;
  for (int i = (0); i <= ((int)(v).size() - 1); i++) {
    double cur = 1;
    for (int j = (0); j <= ((int)(v).size() - 1); j++) {
      cur *= (i == j ? v[i] : 1 - v[j]);
    }
    ans += cur;
  }
  cout << fixed << setprecision(13) << ans << "\n";
  return 0;
}
