#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  reverse(a, a + n);
  double s = 0, p = 1, ans = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] >= 0.999999999) {
      cout << "1";
      return 0;
    }
    s += a[i] / (1 - a[i]);
    p *= (1 - a[i]);
    ans = max(ans, s * p);
  }
  printf("%0.9f", ans);
  return 0;
}
