#include <bits/stdc++.h>
using namespace std;
int n;
long double a[150];
long double dp, foo;
long double tmp;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  dp = a[n - 1];
  foo = 1 - dp;
  for (int i = 1; i < n; ++i) {
    tmp = dp * (1 - a[n - 1 - i]) + a[n - 1 - i] * foo;
    if (tmp > dp) {
      foo *= (1 - a[n - 1 - i]);
      dp = tmp;
    }
    if (dp < a[n - 1 - i]) {
      dp = a[n - 1 - i];
      foo = 1 - dp;
    }
  }
  cout.precision(10);
  cout << fixed << dp << "\n";
  return 0;
}
