#include <bits/stdc++.h>
int compare_function(const void *a, const void *b) {
  double *x = (double *)a;
  double *y = (double *)b;
  if (*x < *y) return 1;
  if (*x > *y) return -1;
  return 0;
}
int main(int argc, const char *argv[]) {
  unsigned i, n;
  scanf("%u", &n);
  double A[100] = {0};
  for (i = 0; i < n; i++) scanf("%lf", A + i);
  qsort(A, n, sizeof(double), compare_function);
  double S = 0, P = 1;
  i = 0;
  if (A[0] == 1.0)
    printf("%.9f\n", A[0]);
  else {
    while (A[i] == 1) i++;
    while (S < 1.0 && i < n) {
      S += A[i] / (1 - A[i]);
      P *= (1 - A[i]);
      i++;
    }
    printf("%.9f\n", S * P);
  }
  return 0;
}
