#include <bits/stdc++.h>
using namespace std;
const int inf = 109;
int n;
long double a[inf], ans = 0.0;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n);
  if (a[n] == 1.0) cout << "1.00000000000" << endl, exit(0);
  for (int i = n; i >= 1; i--) {
    long double cury = 1.0, cur = 0.0;
    for (int j = i; j <= n; j++) cury = cury * (1.0 - a[j]);
    for (int j = i; j <= n; j++) cur += a[j] * (cury / (1.0 - a[j]));
    ans = max(ans, cur);
  }
  cout << fixed << setprecision(10) << ans << endl;
}
