#include <bits/stdc++.h>
using namespace std;
template <typename T>
T sqr(T x) {
  return x * x;
}
template <typename T>
T abs(T x) {
  return x < 0 ? -x : x;
}
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
double a[200], ma, x = 1;
int n;
int main() {
  ios_base ::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int i = n; i; i--)
    if (ma * (1 - a[i]) + a[i] * x > ma)
      ma = ma * (1 - a[i]) + a[i] * x, x *= 1 - a[i];
    else
      break;
  printf("%.9f", ma);
}
