#include <bits/stdc++.h>
using namespace std;
double dp[100][2];
double a[100];
int n;
int main() {
  memset(dp, -2, sizeof(dp));
  n = ({
    int x;
    scanf("%d", &x);
    x;
  });
  for (int i = (0); i < (n); i += (1)) {
    cin >> a[i];
    if (fabs(a[i] - 1.0) < 1e-9) {
      cout << 1 << endl;
      exit(0);
    }
  }
  sort(a, a + n);
  double P = 1, string = 0;
  double ans = a[0];
  for (int i = (n - 1); i >= (0); i--) {
    P *= (1 - a[i]);
    string += a[i] / (1 - a[i]);
    ans = max(ans, P * string);
    if (string > 1) break;
  }
  printf("%.9lf\n", ans);
}
