#include <bits/stdc++.h>
using namespace std;
mt19937 rng32(chrono::steady_clock::now().time_since_epoch().count());
long long inf = 1e18, MOD = 1e9 + 7;
void solve() {
  int n;
  cin >> n;
  vector<long double> in;
  for (int i = 0; i < n; i++) {
    long double t;
    cin >> t;
    if (t == 1) {
      cout << 1 << endl;
      return;
    }
    if (t != 0) in.push_back(1.0 - t);
  }
  long double ans = 0.0;
  n = in.size();
  sort(in.begin(), in.end());
  for (int i = 0; i < n; i++) {
    for (int j = i; j < n; j++) {
      long double cur = -j + i - 1;
      for (int k = i; k <= j; k++) {
        cur += 1.0 / in[k];
      }
      for (int k = i; k <= j; k++) {
        cur *= in[k];
      }
      ans = max(ans, cur);
    }
  }
  cout << fixed << setprecision(12) << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int ti = 1;
  for (int i = 1; i <= ti; i++) {
    solve();
  }
  return 0;
}
