#include <bits/stdc++.h>
using namespace std;
long double a[200];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  long double ans = 0.0;
  long double ch = 0.0;
  long double rev = 1.0;
  for (int i = n; 1 <= i; i--) {
    ch *= (1 - a[i]);
    ch += (a[i] * rev);
    rev *= (1 - a[i]);
    ans = max(ans, ch);
  }
  cout << fixed << setprecision(10) << ans << endl;
  return 0;
}
