#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int INF = 2147483647;
const int mod = 1000000007;
const int tmod = 1000000009;
long double p[111];
const long double eps = 1e-11;
int sgn(long double x) { return x > eps ? 1 : x < -eps ? -1 : 0; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < (n); i++) cin >> p[i];
  sort(p, p + n);
  long double ans = 0;
  long double p0 = 1;
  for (int i = n - 1; i >= 0; i--) {
    long double tmp = ans * (1 - p[i]) + p0 * p[i];
    if (sgn(ans - tmp) > 0) break;
    ans = tmp;
    p0 *= (1 - p[i]);
  }
  cout << fixed << setprecision(10);
  cout << ans << '\n';
  return 0;
}
