#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long mod = 1e9 + 7;
const long long N = 2e5 + 5;
int32_t main() {
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<double> v(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  sort(v.rbegin(), v.rend());
  double maxans = 0;
  for (long long k = 0; k < n; k++) {
    double ans = 0;
    for (long long i = 0; i <= k; i++) {
      double p = v[i];
      for (long long j = 0; j <= k; j++) {
        if (j != i) p *= 1 - v[j];
      }
      ans += p;
    }
    maxans = max(maxans, ans);
  }
  cout << fixed << setprecision(9) << maxans << endl;
  return 0;
}
