#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double p[n];
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }
  sort(p, p + n);
  double temp = 0, ans = 0, prod = 1;
  for (int i = n - 1; i >= 0; i--) {
    temp = temp * (1 - p[i]) + p[i] * prod;
    prod *= (1 - p[i]);
    if (temp > ans) ans = temp;
  }
  cout << fixed << setprecision(10) << ans << "\n";
}
