#include <bits/stdc++.h>
using namespace std;
double probabilitate[150];
double MAX;
int N, i, limita;
double calcul(int N) {
  double first = 1.0, second = 0.0;
  int i;
  for (i = 0; i < limita; ++i) {
    second =
        first * probabilitate[N + i] + second * (1.0 - probabilitate[N + i]);
    first *= 1.0 - probabilitate[N + i];
  }
  return second;
}
int main() {
  scanf("%d", &N);
  for (i = 0; i < N; i++) scanf("%lf", &probabilitate[i]);
  sort(probabilitate, probabilitate + N);
  for (limita = 1; limita <= N; ++limita)
    for (i = 0; i <= N - limita; ++i) MAX = max(MAX, calcul(i));
  printf("%.15lf\n", MAX);
}
