#include <bits/stdc++.h>
using namespace std;
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
int dx[] = {0, 0, 1, -1};
int dy[] = {-1, 1, 0, 0};
vector<long double> prob;
long double a, b, c, tmp, ans, mul;
int main() {
  int i, j, k, l, kase = 0;
  int N;
  while (scanf("%d", &N) == 1) {
    prob.clear();
    for (i = 0; i < N; i++) {
      cin >> a;
      prob.push_back(a);
    }
    sort(prob.begin(), prob.end());
    reverse(prob.begin(), prob.end());
    if (prob[0] == 1.0)
      ans = 1.0;
    else {
      ans = 0.0;
      for (k = 1; k <= N; k++) {
        tmp = 0.0;
        mul = 1.0;
        for (i = 0; i < k; i++) mul = mul * (1.0 - prob[i]);
        for (i = 0; i < k; i++) tmp = tmp + (mul * prob[i]) / (1.0 - prob[i]);
        if (tmp >= ans)
          ans = tmp;
        else
          break;
      }
    }
    cout << fixed << setprecision(10) << ans << endl;
  }
  return 0;
}
