#include <bits/stdc++.h>
using namespace std;
int n;
double p[105], q[105], ans;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }
  sort(p, p + n);
  for (int i = 0; i < n; i++) {
    if (p[i] == 1) {
      cout << 1 << endl;
      return 0;
    }
    q[i] = p[i] / (1 - p[i]);
    q[i] += q[i - 1];
  }
  for (int i = 0; i < n; i++) {
    double product = 1;
    for (int j = i; j < n; j++) {
      product *= (1 - p[j]);
      ans = max(ans, (q[j] - q[i - 1]) * product);
    }
  }
  cout << fixed << setprecision(12) << ans << endl;
}
