#include <bits/stdc++.h>
using namespace std;
int fastMax(int x, int y) { return (((y - x) >> (32 - 1)) & (x ^ y)) ^ y; }
int fastMin(int x, int y) { return (((y - x) >> (32 - 1)) & (x ^ y)) ^ x; }
const long long int MAXN = 105;
long double a[MAXN];
void solve() {
  long long int n;
  cin >> n;
  for (int i = (1); i <= (n); ++i) cin >> a[i];
  sort(a + 1, a + n + 1);
  if (a[n] >= 1) {
    cout << a[n] << '\n';
    return;
  }
  long double S = a[n] / (1. - a[n]);
  long double P = (1. - a[n]);
  long double prob = P * S;
  for (int i = (n - 1); i >= (1); --i) {
    long double newprod = prob + P * (1. - S) * a[i];
    if (newprod > prob) {
      prob = newprod;
      P = P * (1. - a[i]);
      S = S + a[i] / (1. - a[i]);
    }
  }
  cout << fixed << setprecision(10) << prob << '\n';
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t;
  t = 1;
  for (int i = (1); i <= (t); ++i) {
    solve();
  }
}
