#include <bits/stdc++.h>
using namespace std;
const int OO = 1e9 + 7;
const int MOD = 1e9 + 7;
const int N = 1e2 + 7;
int n;
double p[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  vector<double> vec;
  for (int i = 0; i <= n - 1; i++) {
    cin >> p[i];
    vec.push_back(p[i]);
  }
  sort(vec.rbegin(), vec.rend());
  double ans = 0;
  for (int i = 0; i <= n - 1; i++) {
    double x = 0;
    for (int j = 0; j <= i; j++) {
      double g = vec[j];
      for (int k = 0; k <= i; k++) {
        if (k == j) continue;
        g *= (1 - vec[k]);
      }
      x += g;
    }
    ans = max(ans, x);
  }
  cout << fixed << setprecision(9) << ans << endl;
  return 0;
}
