#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
inline long long add(long long x, long long y) {
  x += y;
  if (x >= mod) x -= mod;
  return x;
}
inline long long mul(long long x, long long y) {
  x = (1LL * x * y) % mod;
  return x;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  double p[n + 1];
  for (long long i = 1; i <= n; ++i) cin >> p[i];
  sort(p + 1, p + n + 1);
  double ans = p[n];
  double val = p[n];
  for (long long i = n - 1; i >= 1; --i) {
    val = val * (1 - p[i]);
    double qw = p[i];
    for (long long j = n; j >= i + 1; --j) qw = qw * (1 - p[j]);
    val += qw;
    if (val > ans) ans = val;
  }
  cout.precision(12);
  cout << fixed << ans << endl;
  return 0;
}
