#include <bits/stdc++.h>
using namespace std;
double p[100];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, i, j;
  double x = 1, y, z = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> p[i];
    p[i] = 1 - p[i];
  }
  sort(p, p + n);
  if (p[0] == 0) {
    cout << 1;
    return 0;
  }
  for (i = 0; i < n; i++) {
    x *= p[i];
    y = 0;
    for (j = 0; j <= i; j++) y += x / p[j] * (1 - p[j]);
    z = max(y, z);
  }
  cout << fixed << setprecision(9) << z;
}
