#include <bits/stdc++.h>
int main() {
  int num, i, j, k, p;
  double prob[110], temp, tot, high, temp2;
  scanf("%d", &num);
  i = 0;
  while (i < num) {
    scanf("%lf", &prob[i]);
    i++;
  }
  i = 0;
  while (i < num) {
    p = i + 1;
    while (p < num) {
      if (prob[p] > prob[i]) {
        temp2 = prob[p];
        prob[p] = prob[i];
        prob[i] = temp2;
      }
      p++;
    }
    i++;
  }
  high = 0;
  i = 1;
  while (i <= num) {
    tot = 0;
    for (j = 0; j < i; j++) {
      temp = prob[j];
      for (k = 0; k < i; k++) {
        if (j != k) temp *= 1 - prob[k];
      }
      tot += temp;
    }
    if (tot > high) high = tot;
    i++;
  }
  printf("%.12f\n", high);
}
