#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const double pi = acos(-1);
const double EPS = 1e-9;
long long binpowmod(long long a, long long b) {
  a %= MOD;
  long long ret = 1;
  while (b) {
    if (b & 1) ret = ret * a % MOD;
    a = a * a % MOD;
    b >>= 1;
  }
  return ret % MOD;
}
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
const int N = 1 << 18;
const int E = N * 2;
class UnionFind {
 public:
  vector<int> p, rank, setSize;
  int numSets;
  UnionFind(int N) {
    setSize.assign(N, 1);
    numSets = N;
    rank.assign(N, 0);
    p.assign(N, 0);
    for (int i = 0; i < N; i++) p[i] = i;
  }
  int findSet(int i) { return (p[i] == i) ? i : (p[i] = findSet(p[i])); }
  bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
  void unionSet(int i, int j) {
    if (!isSameSet(i, j)) {
      numSets--;
      int x = findSet(i), y = findSet(j);
      if (rank[x] > rank[y]) {
        p[y] = x;
        setSize[x] += setSize[y];
      } else {
        p[x] = y;
        setSize[y] += setSize[x];
        if (rank[x] == rank[y]) rank[y]++;
      }
    }
  }
  int numDisjointSets() { return numSets; }
  int sizeOfSet(int i) { return setSize[findSet(i)]; }
};
void solve() {
  int n;
  cin >> n;
  double ans = 0.0;
  vector<double> v(n);
  for (int i = 0; i < n; ++i) cin >> v[i];
  sort(v.rbegin(), v.rend());
  for (int i = 0; i < n; ++i) {
    double cur = 0.0;
    for (int j = 0; j <= i; ++j) {
      double neg = 1.0;
      for (int k = 0; k <= i; ++k) {
        if (k != j) neg *= (1 - v[k]);
      }
      cur += v[j] * neg;
    }
    ans = max(ans, cur);
  }
  cout << fixed << setprecision(10) << ans << '\n';
}
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int tc = 1;
  while (tc--) {
    solve();
  }
}
