#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long n;
vector<double> a(101);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) {
    cin >> n;
    double mx = 0;
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    if (mx >= 0.5) {
      cout << fixed << setprecision(10) << mx << "\n";
      return 0;
    }
    sort((a).begin(), (a).end(), greater<double>());
    double ans = 0;
    for (long long int len = 1; len < n + 1; len++) {
      double a1 = 0;
      for (long long int i = 0; i < len; i++) {
        double lo = a[i];
        for (long long int j = 0; j < len; j++) {
          if (j == i) continue;
          lo *= (1 - a[j]);
        }
        a1 += lo;
      }
      ans = max(a1, ans);
    }
    cout << fixed << setprecision(10) << ans << "\n";
  }
  return 0;
}
