#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
bool cmp(double a, double b) { return a > b; }
int n;
double a[105];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 0; i <= n - 1; i++) cin >> a[i];
  sort(a, a + n, cmp);
  double current_1 = 0;
  double current_none = 1;
  double temp;
  double x;
  for (long long i = 0; i <= n - 1; i++) {
    x = a[i];
    temp = current_1 * (1 - x) + x * current_none;
    if (temp > current_1) {
      current_1 = temp;
      current_none = current_none * (1 - x);
    } else
      break;
  }
  cout << setprecision(10) << current_1;
  return 0;
}
