#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long INFL = LLONG_MAX;
vector<long double> small;
long double maximum, p;
int N;
long double calculate2() {
  if (small.size() == 0) return 0;
  long double res = 0;
  for (int(j) = 0; (j) < (small.size()); (j)++) {
    long double total = 1.0;
    for (int(k) = 0; (k) < (small.size()); (k)++)
      if (j == k) {
        total *= small[k];
      } else {
        total *= (1 - small[k]);
      }
    res += total;
  }
  return res;
}
long double calculate(int n) {
  if (small.size() == 0) return 0;
  long double res = 0;
  long double total = 1;
  for (int(j) = 0; (j) < (n); (j)++) total *= (1 - small[j]);
  for (int(j) = 0; (j) < (n); (j)++) res += (total / (1 - small[j])) * small[j];
  return res;
}
int comp(long double a, long double b) { return a > b; }
int main() {
  ios_base::sync_with_stdio(0);
  cout.precision(15);
  cin >> N;
  for (int(i) = 1; (i) <= (N); (i)++) {
    cin >> p;
    maximum = max(maximum, p);
    if (p > 0) small.push_back(p);
  }
  sort(small.begin(), small.end(), comp);
  for (int(i) = 1; (i) <= (small.size()); (i)++)
    maximum = max(maximum, calculate(i));
  cout << maximum << endl;
}
