#include <bits/stdc++.h>
using namespace std;
int n;
double p[105], suff[105];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> p[i];
  }
  sort(p + 1, p + n + 1);
  cout << fixed << setprecision(10);
  if (p[n] == 1) {
    cout << 1. << '\n';
    return 0;
  }
  suff[n] = 1 - p[n];
  for (int i = n - 1; i >= 1; i--) {
    suff[i] = (1 - p[i]) * suff[i + 1];
  }
  double ans = 0;
  for (int i = n; i >= 1; i--) {
    double tmp = 0;
    for (int j = i; j <= n; j++) {
      tmp += p[j] / (1 - p[j]);
    }
    tmp *= suff[i];
    ans = max(ans, tmp);
  }
  cout << ans << '\n';
}
