#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  double p[n];
  for (int i = 0; i < n; ++i) {
    cin >> p[i];
  }
  sort(p, p + n);
  double P = 1.0000000000, S = 0.0000000000, ans = 0.0000000000;
  for (int i = n - 1; i >= 0; --i) {
    if (S <= 1.0000000000) {
      double delta;
      delta = P * p[i] * (1 - S);
      ans += delta;
      S += (p[i] / (1 - p[i]));
      P *= (1 - p[i]);
    } else {
      continue;
    }
  }
  cout << setprecision(9) << ans << endl;
  return 0;
}
