#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
double success[110], failure[110], prod[110];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  double temp[n];
  for (long long i = 0; i < (n); ++i) cin >> temp[i];
  sort(temp, temp + n, greater<double>());
  for (long long i = 0; i < (n); ++i) {
    success[i] = temp[i];
    failure[i] = 1 - temp[i];
    prod[i] = failure[i];
    if (i) prod[i] *= prod[i - 1];
  }
  double maxProb = success[0], curProb = success[0];
  for (long long i = (1); i < (n); ++i) {
    curProb = curProb * failure[i] + prod[i - 1] * success[i];
    maxProb = max(maxProb, curProb);
  }
  cout << setprecision(20) << maxProb << '\n';
  return 0;
}
