#include <bits/stdc++.h>
using namespace std;
const double pi =
    3.14159265358979323846264338327950288419716939937510582097494459;
int dX[] = {0, 0, 1, -1, 0};
int dY[] = {1, -1, 0, 0, 0};
string alpha = "abcdefghijklmnopqrstuvwxyz";
const int MOD = 1000000007;
const int N = 150;
int n;
double arr[N];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> arr[i];
  sort(arr, arr + n);
  reverse(arr, arr + n);
  double cur = 0, pre = 1, ans = 0;
  for (int i = 0; i < n; ++i) {
    double p = arr[i];
    cur = cur * (1 - p) + pre * p;
    pre *= (1 - p);
    ans = max(cur, ans);
  }
  printf("%.12f", ans);
  return 0;
}
