#include <bits/stdc++.h>
using namespace std;
void zanj0() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
void solve() {
  long long int n;
  cin >> n;
  vector<long double> v(n);
  for (long long int i = 0; i < n; i++) {
    cin >> v[i];
  }
  long double ret = 0;
  sort(v.rbegin(), v.rend());
  ret = v[0];
  long double temp = 0;
  long double prob = 1;
  long double sum = 0;
  for (auto& it : v) {
    sum += it / (1 - it);
    prob *= (1 - it);
    ret = max(ret, sum * prob);
    if (sum > 1) break;
  }
  cout << fixed << setprecision(12) << ret << "\n";
}
int32_t main() {
  zanj0();
  solve();
  cerr << "Time : " << 1000 * (long double)clock() / (long double)CLOCKS_PER_SEC
       << "ms\n";
  return 0;
}
