#include <bits/stdc++.h>
using namespace std;
double calc(vector<double> v) {
  int length = v.size();
  double temp, ans = 0;
  for (int i = length - 1; i >= 0; i--) {
    temp = 1;
    for (int j = length - 1; j >= 0; j--) {
      if (i == j)
        continue;
      else
        temp *= (1 - v[j]);
    }
    ans += temp * v[i];
  }
  return ans;
}
int main() {
  int N;
  cin >> N;
  vector<double> input;
  double temp;
  for (int i = 0; i < N; i++) {
    cin >> temp;
    input.push_back(temp);
  }
  sort(input.begin(), input.end());
  int length = input.size();
  double final = 0;
  if (input[length - 1] >= .5) {
    printf("%.9lf", input[length - 1]);
  } else {
    vector<double> v;
    for (int i = length - 1; i >= 0; i--) {
      v.push_back(input[i]);
      if (final > calc(v)) {
        v.pop_back();
      } else
        final = calc(v);
    }
  }
  cout << setprecision(10) << final;
  return 0;
}
