#include <bits/stdc++.h>
void solve(int n) {
  int i, j, k, l;
  double f[100], ans, p, s;
  for (i = 0; i < n; i++) scanf("%lf", &f[i]);
  std::sort(f, f + n);
  ans = f[n - 1];
  p = 1 - f[n - 1];
  s = f[n - 1] / (1 - f[n - 1]);
  for (i = n - 2; i >= 0; i--)
    if (ans < p * (1 - f[i]) * (s + f[i] / (1 - f[i]))) {
      ans = p * (1 - f[i]) * (s + f[i] / (1 - f[i]));
      p = p * (1 - f[i]);
      s = s + f[i] / (1 - f[i]);
    }
  printf("%.9lf\n", ans);
}
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    solve(n);
  }
  return 0;
}
