#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
string yes = "YES\n";
string no = "NO\n";
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long double n, t;
  cin >> n;
  vector<long double> a;
  for (long long i = 0; i < n; i++) cin >> t, a.push_back(t);
  sort(a.begin(), a.end(), greater<long double>());
  if (a[0] == 1) {
    cout << 1 << "\n";
    return 0;
  }
  long double mx = a[0];
  long double sum = a[0] / (1 - a[0]);
  long double product = 1 - a[0];
  for (long long i = 1; i < n; i++) {
    sum += a[i] / (1 - a[i]);
    product *= (1 - a[i]);
    mx = max(mx, sum * product);
  }
  cout << fixed << setprecision(20) << mx << "\n";
}
