#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<double> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v.rbegin(), v.rend());
  double ans = v[0], a = v[0], b = 1 - v[0];
  for (int i = 1; i < n; i++) {
    a = (a * (1 - v[i]) + b * v[i]);
    b = (b * (1 - v[i]));
    ans = max(ans, a);
  }
  cout << setprecision(10) << ans;
}
