#include <bits/stdc++.h>
using namespace std;
int main() {
  double s, x[100], a, p;
  int y[100];
  int i, n, j;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x[i];
    y[i] = 0;
  }
  sort(x, x + n);
  s = x[n - 1];
  p = 1 - x[n - 1];
  for (i = n - 2; i >= 0; i--) {
    a = s * (1 - x[i]) + x[i] * p;
    p *= 1 - x[i];
    if (a >= s)
      s = a;
    else
      break;
  }
  printf("%.9f", s);
  return 0;
}
