#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
inline int Add(int x) { return x >= mod ? x - mod : x; }
inline int Sub(int x) { return x < 0 ? x + mod : x; }
inline void Add(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
inline void Sub(int &x, int y) {
  x -= y;
  if (x < 0) x += mod;
}
inline int Mul(int x, int y) { return (unsigned long long)x * y % mod; }
inline int Mul(int x, int y, int z) { return Mul(Mul(x, y), z); }
template <class T>
inline void Max(T &x, T y) {
  if (y > x) x = y;
}
template <class T>
inline void Min(T &x, T y) {
  if (y < x) x = y;
}
int Pow(int x, int y) {
  int z = 1;
  for (; y; y >>= 1) {
    if (y & 1) z = Mul(z, x);
    x = Mul(x, x);
  }
  return z;
}
int Pow(int x, unsigned long long y) { return Pow(x, y % (mod - 1)); }
const int maxn = 100;
int n;
double p[maxn];
int main(void) {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%lf", p + i);
  }
  sort(p, p + n);
  double ans = 0, P0 = 1, P1 = 0;
  for (int i = n - 1; i >= 0; --i) {
    double Q0 = P0 * (1 - p[i]);
    double Q1 = P1 * (1 - p[i]) + P0 * p[i];
    Max(ans, Q1);
    P0 = Q0, P1 = Q1;
  }
  printf("%.10lf\n", ans);
  return 0;
}
