#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 10;
long double a[N];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i <= n - 1; i++) cin >> a[i];
  sort(a, a + n, greater<long double>());
  long double ans = 0, x = 1;
  for (int i = 0; i <= n - 1; i++) {
    ans = max(ans, ans * (1 - a[i]) + x * a[i]);
    x *= 1 - a[i];
  }
  cout << fixed << setprecision(9) << ans << endl;
  return 0;
}
