#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 10;
long double p[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> p[i];
  sort(p, p + n);
  reverse(p, p + n);
  for (int i = 0; i < n; i++)
    if (p[i] == 1.0) {
      cout.precision(12);
      cout << fixed << p[i] << endl;
      return 0;
    }
  vector<long double> v;
  for (int i = 0; i < n; i++) {
    long double p1 = 1.0;
    for (int j = 0; j < v.size(); j++) p1 *= (1.0 - v[j]);
    long double p2 = 0.0;
    for (int j = 0; j < v.size(); j++) p2 += v[j] * p1 / (1.0 - v[j]);
    if (p2 * (1.0 - p[i]) + p1 * p[i] > p2) v.push_back(p[i]);
  }
  long double p1 = 1.0;
  for (int i = 0; i < v.size(); i++) p1 *= (1.0 - v[i]);
  long double p2 = 0.0;
  for (int i = 0; i < v.size(); i++) p2 += v[i] * p1 / (1.0 - v[i]);
  cout.precision(12);
  cout << fixed << p2 << endl;
  return 0;
}
