#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 6;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  double Arr[n + 2];
  for (int i = 0; i < n; i++) cin >> Arr[i];
  sort(Arr, Arr + n, greater<double>());
  double mx = 0, mul = 1;
  for (int i = 0; i < n; i++) {
    double nw = mx * (1 - Arr[i]) + mul * Arr[i];
    if (nw > mx) mx = nw, mul *= (1 - Arr[i]);
  }
  cout << fixed;
  cout << setprecision(10);
  cout << mx << "\n";
}
