#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<double> a;
  for (long long i = 0; i < n; i++) {
    double x;
    cin >> x;
    a.push_back(x);
  }
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  double ans = a[0], maxi = a[0], un = (1 - a[0]);
  for (long long i = 1; i < n; i++) {
    ans = ans * (1 - a[i]) + a[i] * un;
    un = un * (1 - a[i]);
    maxi = max(maxi, ans);
  }
  cout << fixed << setprecision(10) << maxi << endl;
  return 0;
}
