#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  vector<double> arr;
  for (long long i = 0; i < n; i++) {
    double a;
    cin >> a;
    arr.push_back(a);
  }
  sort(arr.begin(), arr.end(), greater<double>());
  double ans = arr[0];
  double lst = 1 - arr[0];
  for (long long i = 1; i < n; i++) {
    double temp = arr[i] * (lst) + (1 - arr[i]) * ans;
    if (temp > ans) {
      ans = temp;
    } else {
      break;
    }
    lst *= (1 - arr[i]);
  }
  cout << fixed << setprecision(10) << ans << endl;
}
