#include <bits/stdc++.h>
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
const int M = 8e3 + 1;
const int MD = 998244353;
long double a[M], ans = 0, pre = 1, s = 0;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (int i = n - 1; i >= 0 && s < 1; i--) {
    ans += pre * a[i] * (1 - s);
    pre = pre * (1 - a[i]);
    s += a[i] / (1 - a[i]);
  }
  cout << fixed << setprecision(12);
  cout << ans;
  return 0;
}
