#include <bits/stdc++.h>
using namespace std;
int n;
double arr[110];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  reverse(arr, arr + n);
  double ret = arr[0], bad = 1 - arr[0];
  for (int i = 1; i < n; i++) {
    if (ret >= bad) break;
    ret += arr[i] * (bad - ret);
    bad *= 1 - arr[i];
  }
  cout << setprecision(9) << fixed << ret << endl;
  return 0;
}
